12 typedef struct W_FontPanel
{
36 #define MIN_UPPER_HEIGHT 20
37 #define MIN_LOWER_HEIGHT 140
40 #define MAX_FONTS_TO_RETRIEVE 2000
42 #define BUTTON_SPACE_HEIGHT 40
45 #define MIN_HEIGHT (MIN_UPPER_HEIGHT+MIN_LOWER_HEIGHT+BUTTON_SPACE_HEIGHT)
47 #define DEF_UPPER_HEIGHT 60
48 #define DEF_LOWER_HEIGHT 310
51 #define DEF_HEIGHT (DEF_UPPER_HEIGHT+DEF_LOWER_HEIGHT)
56 static int scalableFontSizes
[] = {
73 static void getSelectedFont(FontPanel
*panel
, char buffer
[]);
76 static void arrangeLowerFrame(FontPanel
*panel
);
78 static void familyClick(WMWidget
*, void *);
79 static void typefaceClick(WMWidget
*, void *);
80 static void sizeClick(WMWidget
*, void *);
83 static void listFamilies(WMScreen
*scr
, WMFontPanel
*panel
);
87 splitViewConstrainCallback(WMSplitView
*sPtr
, int indView
, int *min
, int *max
)
90 *min
= MIN_UPPER_HEIGHT
;
92 *min
= MIN_LOWER_HEIGHT
;
96 notificationObserver(void *self
, WMNotification
*notif
)
98 WMFontPanel
*panel
= (WMFontPanel
*)self
;
99 void *object
= WMGetNotificationObject(notif
);
101 if (WMGetNotificationName(notif
) == WMViewSizeDidChangeNotification
) {
102 if (object
== WMWidgetView(panel
->win
)) {
103 int h
= WMWidgetHeight(panel
->win
);
104 int w
= WMWidgetWidth(panel
->win
);
106 WMResizeWidget(panel
->split
, w
, h
-BUTTON_SPACE_HEIGHT
);
108 WMMoveWidget(panel
->setB
, w
-80, h
-(BUTTON_SPACE_HEIGHT
-5));
110 WMMoveWidget(panel
->revertB
, w
-240, h
-(BUTTON_SPACE_HEIGHT
-5));
112 } else if (object
== WMWidgetView(panel
->upperF
)) {
114 if (WMWidgetHeight(panel
->upperF
) < MIN_UPPER_HEIGHT
) {
115 WMResizeWidget(panel
->upperF
, WMWidgetWidth(panel
->upperF
),
118 WMResizeWidget(panel
->sampleT
, WMWidgetWidth(panel
->upperF
)-20,
119 WMWidgetHeight(panel
->upperF
)-10);
122 } else if (object
== WMWidgetView(panel
->lowerF
)) {
124 if (WMWidgetHeight(panel
->lowerF
) < MIN_LOWER_HEIGHT
) {
125 WMResizeWidget(panel
->upperF
, WMWidgetWidth(panel
->upperF
),
128 WMMoveWidget(panel
->lowerF
, 0, WMWidgetHeight(panel
->upperF
)
129 + WMGetSplitViewDividerThickness(panel
->split
));
131 WMResizeWidget(panel
->lowerF
, WMWidgetWidth(panel
->lowerF
),
132 WMWidgetWidth(panel
->split
) - MIN_UPPER_HEIGHT
133 - WMGetSplitViewDividerThickness(panel
->split
));
135 arrangeLowerFrame(panel
);
143 closeWindow(WMWidget
*w
, void *data
)
145 FontPanel
*panel
= (FontPanel
*)data
;
147 WMHideFontPanel(panel
);
153 WMGetFontPanel(WMScreen
*scr
)
156 WMColor
*dark
, *white
;
160 if (scr
->sharedFontPanel
)
161 return scr
->sharedFontPanel
;
164 panel
= wmalloc(sizeof(FontPanel
));
165 memset(panel
, 0, sizeof(FontPanel
));
167 panel
->win
= WMCreateWindow(scr
, "fontPanel");
168 /* WMSetWidgetBackgroundColor(panel->win, WMWhiteColor(scr));*/
169 WMResizeWidget(panel
->win
, DEF_WIDTH
, DEF_HEIGHT
);
170 WMSetWindowMinSize(panel
->win
, MIN_WIDTH
, MIN_HEIGHT
);
171 WMSetViewNotifySizeChanges(WMWidgetView(panel
->win
), True
);
173 WMSetWindowCloseAction(panel
->win
, closeWindow
, panel
);
175 panel
->split
= WMCreateSplitView(panel
->win
);
176 WMResizeWidget(panel
->split
, DEF_WIDTH
, DEF_HEIGHT
- BUTTON_SPACE_HEIGHT
);
177 WMSetSplitViewConstrainProc(panel
->split
, splitViewConstrainCallback
);
179 divThickness
= WMGetSplitViewDividerThickness(panel
->split
);
181 panel
->upperF
= WMCreateFrame(panel
->win
);
182 WMSetFrameRelief(panel
->upperF
, WRFlat
);
183 WMSetViewNotifySizeChanges(WMWidgetView(panel
->upperF
), True
);
184 panel
->lowerF
= WMCreateFrame(panel
->win
);
185 /* WMSetWidgetBackgroundColor(panel->lowerF, WMBlackColor(scr));*/
186 WMSetFrameRelief(panel
->lowerF
, WRFlat
);
187 WMSetViewNotifySizeChanges(WMWidgetView(panel
->lowerF
), True
);
189 WMAddSplitViewSubview(panel
->split
, W_VIEW(panel
->upperF
));
190 WMAddSplitViewSubview(panel
->split
, W_VIEW(panel
->lowerF
));
192 WMResizeWidget(panel
->upperF
, DEF_WIDTH
, DEF_UPPER_HEIGHT
);
194 WMResizeWidget(panel
->lowerF
, DEF_WIDTH
, DEF_LOWER_HEIGHT
);
196 WMMoveWidget(panel
->lowerF
, 0, 60+divThickness
);
198 white
= WMWhiteColor(scr
);
199 dark
= WMDarkGrayColor(scr
);
201 panel
->sampleT
= WMCreateTextField(panel
->upperF
);
202 WMResizeWidget(panel
->sampleT
, DEF_WIDTH
- 20, 50);
203 WMMoveWidget(panel
->sampleT
, 10, 10);
204 WMSetTextFieldText(panel
->sampleT
, "Test!!!");
206 font
= WMBoldSystemFontOfSize(scr
, 12);
208 panel
->famL
= WMCreateLabel(panel
->lowerF
);
209 WMSetWidgetBackgroundColor(panel
->famL
, dark
);
210 WMSetLabelText(panel
->famL
, "Family");
211 WMSetLabelFont(panel
->famL
, font
);
212 WMSetLabelTextColor(panel
->famL
, white
);
213 WMSetLabelRelief(panel
->famL
, WRSunken
);
214 WMSetLabelTextAlignment(panel
->famL
, WACenter
);
216 panel
->famLs
= WMCreateList(panel
->lowerF
);
217 WMSetListAction(panel
->famLs
, familyClick
, panel
);
219 panel
->typL
= WMCreateLabel(panel
->lowerF
);
220 WMSetWidgetBackgroundColor(panel
->typL
, dark
);
221 WMSetLabelText(panel
->typL
, "Typeface");
222 WMSetLabelFont(panel
->typL
, font
);
223 WMSetLabelTextColor(panel
->typL
, white
);
224 WMSetLabelRelief(panel
->typL
, WRSunken
);
225 WMSetLabelTextAlignment(panel
->typL
, WACenter
);
227 panel
->typLs
= WMCreateList(panel
->lowerF
);
228 WMSetListAction(panel
->typLs
, typefaceClick
, panel
);
230 panel
->sizL
= WMCreateLabel(panel
->lowerF
);
231 WMSetWidgetBackgroundColor(panel
->sizL
, dark
);
232 WMSetLabelText(panel
->sizL
, "Size");
233 WMSetLabelFont(panel
->sizL
, font
);
234 WMSetLabelTextColor(panel
->sizL
, white
);
235 WMSetLabelRelief(panel
->sizL
, WRSunken
);
236 WMSetLabelTextAlignment(panel
->sizL
, WACenter
);
238 panel
->sizT
= WMCreateTextField(panel
->lowerF
);
239 /* WMSetTextFieldAlignment(panel->sizT, WARight);*/
241 panel
->sizLs
= WMCreateList(panel
->lowerF
);
242 WMSetListAction(panel
->sizLs
, sizeClick
, panel
);
245 WMReleaseColor(white
);
246 WMReleaseColor(dark
);
248 panel
->setB
= WMCreateCommandButton(panel
->win
);
249 WMResizeWidget(panel
->setB
, 70, 24);
250 WMMoveWidget(panel
->setB
, 240, DEF_HEIGHT
- (BUTTON_SPACE_HEIGHT
-5));
251 WMSetButtonText(panel
->setB
, "Set");
253 panel
->revertB
= WMCreateCommandButton(panel
->win
);
254 WMResizeWidget(panel
->revertB
, 70, 24);
255 WMMoveWidget(panel
->revertB
, 80, DEF_HEIGHT
- (BUTTON_SPACE_HEIGHT
-5));
256 WMSetButtonText(panel
->revertB
, "Revert");
258 WMRealizeWidget(panel
->win
);
260 WMMapSubwidgets(panel
->upperF
);
261 WMMapSubwidgets(panel
->lowerF
);
262 WMMapSubwidgets(panel
->split
);
263 WMMapSubwidgets(panel
->win
);
265 WMUnmapWidget(panel
->revertB
);
267 arrangeLowerFrame(panel
);
269 scr
->sharedFontPanel
= panel
;
272 /* register notification observers */
273 WMAddNotificationObserver(notificationObserver
, panel
,
274 WMViewSizeDidChangeNotification
,
275 WMWidgetView(panel
->win
));
276 WMAddNotificationObserver(notificationObserver
, panel
,
277 WMViewSizeDidChangeNotification
,
278 WMWidgetView(panel
->upperF
));
279 WMAddNotificationObserver(notificationObserver
, panel
,
280 WMViewSizeDidChangeNotification
,
281 WMWidgetView(panel
->lowerF
));
284 listFamilies(scr
, panel
);
292 WMFreeFontPanel(WMFontPanel
*panel
)
294 if (panel
== WMWidgetScreen(panel
->win
)->sharedFontPanel
) {
295 WMWidgetScreen(panel
->win
)->sharedFontPanel
= NULL
;
297 WMRemoveNotificationObserver(panel
);
298 WMUnmapWidget(panel
->win
);
299 WMDestroyWidget(panel
->win
);
305 WMShowFontPanel(WMFontPanel
*panel
)
307 WMMapWidget(panel
->win
);
312 WMHideFontPanel(WMFontPanel
*panel
)
314 WMUnmapWidget(panel
->win
);
319 WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
)
326 WMSetFontPanelFontName(WMFontPanel
*panel
, char *fontName
)
334 WMGetFontPanelFont(WMFontPanel
*panel
)
336 return WMGetTextFieldFont(panel
->sampleT
);
341 WMGetFontPanelFontName(WMFontPanel
*panel
)
345 getSelectedFont(panel
, name
);
347 return wstrdup(name
);
353 arrangeLowerFrame(FontPanel
*panel
)
355 int width
= WMWidgetWidth(panel
->lowerF
) - 55 - 30;
356 int height
= WMWidgetHeight(panel
->split
) - WMWidgetHeight(panel
->upperF
);
359 #define LABEL_HEIGHT 20
361 height
-= WMGetSplitViewDividerThickness(panel
->split
);
364 height
-= LABEL_HEIGHT
+ 8;
366 fw
= (125*width
) / 235;
367 tw
= (110*width
) / 235;
370 WMMoveWidget(panel
->famL
, 10, 0);
371 WMResizeWidget(panel
->famL
, fw
, LABEL_HEIGHT
);
373 WMMoveWidget(panel
->famLs
, 10, 23);
374 WMResizeWidget(panel
->famLs
, fw
, height
);
376 WMMoveWidget(panel
->typL
, 10+fw
+3, 0);
377 WMResizeWidget(panel
->typL
, tw
, LABEL_HEIGHT
);
379 WMMoveWidget(panel
->typLs
, 10+fw
+3, 23);
380 WMResizeWidget(panel
->typLs
, tw
, height
);
382 WMMoveWidget(panel
->sizL
, 10+fw
+3+tw
+3, 0);
383 WMResizeWidget(panel
->sizL
, sw
+4, LABEL_HEIGHT
);
385 WMMoveWidget(panel
->sizT
, 10+fw
+3+tw
+3, 23);
386 WMResizeWidget(panel
->sizT
, sw
+4, 20);
388 WMMoveWidget(panel
->sizLs
, 10+fw
+3+tw
+3, 46);
389 WMResizeWidget(panel
->sizLs
, sw
+4, height
-23);
395 #define ALL_FONTS_MASK "-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
412 #define NUM_FIELDS 14
417 parseFont(char *font
, char values
[NUM_FIELDS
][256])
421 char buffer
[256], *bptr
;
425 ptr
++; /* skip first - */
430 strcpy(values
[part
], buffer
);
439 strcpy(values
[part
], buffer
);
447 isXLFD(char *font
, int *length_ret
)
458 return c
==NUM_FIELDS
;
471 char showSetWidth
; /* when duplicated */
472 char showAddStyle
; /* when duplicated */
482 char *registry
, *encoding
;
484 char showFoundry
; /* when duplicated */
485 char showRegistry
; /* when duplicated */
494 compare_int(const void *a
, const void *b
)
510 addSizeToTypeface(Typeface
*face
, int size
)
515 for (j
= 0; j
< sizeof(scalableFontSizes
)/sizeof(int); j
++) {
516 size
= scalableFontSizes
[j
];
518 if (!WMCountInArray(face
->sizes
, (void*)size
)) {
519 WMAddToArray(face
->sizes
, (void*)size
);
522 WMSortArray(face
->sizes
, compare_int
);
524 if (!WMCountInArray(face
->sizes
, (void*)size
)) {
525 WMAddToArray(face
->sizes
, (void*)size
);
526 WMSortArray(face
->sizes
, compare_int
);
534 addTypefaceToFamily(Family
*family
, char fontFields
[NUM_FIELDS
][256])
539 if (family
->typefaces
) {
540 WM_ITERATE_ARRAY(family
->typefaces
, face
, i
) {
543 if (strcmp(face
->weight
, fontFields
[WEIGHT
]) != 0) {
546 if (strcmp(face
->slant
, fontFields
[SLANT
]) != 0) {
550 size
= atoi(fontFields
[PIXEL_SIZE
]);
552 addSizeToTypeface(face
, size
);
557 family
->typefaces
= WMCreateArray(4);
560 face
= wmalloc(sizeof(Typeface
));
561 memset(face
, 0, sizeof(Typeface
));
563 face
->weight
= wstrdup(fontFields
[WEIGHT
]);
564 face
->slant
= wstrdup(fontFields
[SLANT
]);
565 face
->setWidth
= wstrdup(fontFields
[SETWIDTH
]);
566 face
->addStyle
= wstrdup(fontFields
[ADD_STYLE
]);
568 face
->sizes
= WMCreateArray(4);
569 addSizeToTypeface(face
, atoi(fontFields
[PIXEL_SIZE
]));
571 WMAddToArray(family
->typefaces
, face
);
577 * families (same family name) (Hashtable of family -> array)
578 * registries (same family but different registries)
583 addFontToFamily(WMHashTable
*families
, char fontFields
[NUM_FIELDS
][256])
590 family
= WMHashGet(families
, fontFields
[FAMILY
]);
593 /* look for same encoding/registry and foundry */
594 WM_ITERATE_ARRAY(family
, fam
, i
) {
597 enc
= (strcmp(fam
->encoding
, fontFields
[ENCODING
]) == 0);
598 reg
= (strcmp(fam
->registry
, fontFields
[REGISTRY
]) == 0);
599 found
= (strcmp(fam
->foundry
, fontFields
[FOUNDRY
]) == 0);
601 if (enc
&& reg
&& found
) {
602 addTypefaceToFamily(fam
, fontFields
);
606 /* look for same encoding/registry */
607 WM_ITERATE_ARRAY(family
, fam
, i
) {
610 enc
= (strcmp(fam
->encoding
, fontFields
[ENCODING
]) == 0);
611 reg
= (strcmp(fam
->registry
, fontFields
[REGISTRY
]) == 0);
614 /* has the same encoding, but the foundry is different */
615 fam
->showFoundry
= 1;
617 fam
= wmalloc(sizeof(Family
));
618 memset(fam
, 0, sizeof(Family
));
620 fam
->name
= wstrdup(fontFields
[FAMILY
]);
621 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
622 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
623 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
624 fam
->showFoundry
= 1;
626 addTypefaceToFamily(fam
, fontFields
);
628 WMAddToArray(family
, fam
);
632 /* look for same foundry */
633 WM_ITERATE_ARRAY(family
, fam
, i
) {
636 found
= (strcmp(fam
->foundry
, fontFields
[FOUNDRY
]) == 0);
639 /* has the same foundry, but encoding is different */
640 fam
->showRegistry
= 1;
642 fam
= wmalloc(sizeof(Family
));
643 memset(fam
, 0, sizeof(Family
));
645 fam
->name
= wstrdup(fontFields
[FAMILY
]);
646 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
647 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
648 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
649 fam
->showRegistry
= 1;
651 addTypefaceToFamily(fam
, fontFields
);
653 WMAddToArray(family
, fam
);
657 /* foundry and encoding do not match anything known */
658 fam
= wmalloc(sizeof(Family
));
659 memset(fam
, 0, sizeof(Family
));
661 fam
->name
= wstrdup(fontFields
[FAMILY
]);
662 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
663 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
664 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
665 fam
->showFoundry
= 1;
666 fam
->showRegistry
= 1;
668 addTypefaceToFamily(fam
, fontFields
);
670 WMAddToArray(family
, fam
);
674 family
= WMCreateArray(8);
676 fam
= wmalloc(sizeof(Family
));
677 memset(fam
, 0, sizeof(Family
));
679 fam
->name
= wstrdup(fontFields
[FAMILY
]);
680 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
681 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
682 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
684 addTypefaceToFamily(fam
, fontFields
);
686 WMAddToArray(family
, fam
);
688 WMHashInsert(families
, fam
->name
, family
);
694 listFamilies(WMScreen
*scr
, WMFontPanel
*panel
)
699 WMHashTable
*families
= WMCreateHashTable(WMStringPointerHashCallbacks
);
700 char fields
[NUM_FIELDS
][256];
701 WMHashEnumerator enumer
;
704 fontList
= XListFonts(scr
->display
, ALL_FONTS_MASK
, MAX_FONTS_TO_RETRIEVE
,
707 WMRunAlertPanel(scr
, panel
->win
, "Error",
708 "Could not retrieve font list", "OK", NULL
, NULL
);
712 for (i
= 0; i
< count
; i
++) {
715 if (!isXLFD(fontList
[i
], &fname_len
)) {
719 if (fname_len
> 255) {
720 wwarning("font name %s is longer than 256, which is invalid.",
725 if (!parseFont(fontList
[i
], fields
)) {
729 addFontToFamily(families
, fields
);
732 enumer
= WMEnumerateHashTable(families
);
734 while ((array
= WMNextHashEnumeratorItem(&enumer
))) {
740 WM_ITERATE_ARRAY(array
, fam
, i
) {
741 strcpy(buffer
, fam
->name
);
743 if (fam
->showFoundry
) {
745 strcat(buffer
, fam
->foundry
);
748 if (fam
->showRegistry
) {
749 strcat(buffer
, " (");
750 strcat(buffer
, fam
->registry
);
752 strcat(buffer
, fam
->encoding
);
755 item
= WMAddListItem(panel
->famLs
, buffer
);
757 item
->clientData
= fam
;
759 /* Isn't this going to memleak since items weren't released? --Dan */
762 WMSortListItems(panel
->famLs
);
764 WMFreeHashTable(families
);
769 getSelectedFont(FontPanel
*panel
, char buffer
[])
777 item
= WMGetListSelectedItem(panel
->famLs
);
780 family
= (Family
*)item
->clientData
;
782 item
= WMGetListSelectedItem(panel
->typLs
);
785 face
= (Typeface
*)item
->clientData
;
787 size
= WMGetTextFieldText(panel
->sizT
);
789 sprintf(buffer
, "-%s-%s-%s-%s-%s-%s-%s-*-*-*-*-*-%s-%s",
804 preview(FontPanel
*panel
)
809 getSelectedFont(panel
, buffer
);
811 font
= WMCreateFont(WMWidgetScreen(panel
->win
), buffer
);
813 WMSetTextFieldFont(panel
->sampleT
, font
);
821 familyClick(WMWidget
*w
, void *data
)
823 WMList
*lPtr
= (WMList
*)w
;
826 FontPanel
*panel
= (FontPanel
*)data
;
829 /* current typeface and size */
835 /* must try to keep the same typeface and size for the new family */
836 item
= WMGetListSelectedItem(panel
->typLs
);
838 oface
= wstrdup(item
->text
);
840 osize
= WMGetTextFieldText(panel
->sizT
);
843 item
= WMGetListSelectedItem(lPtr
);
844 family
= (Family
*)item
->clientData
;
846 WMClearList(panel
->typLs
);
849 WM_ITERATE_ARRAY(family
->typefaces
, face
, i
) {
854 if (strcmp(face
->weight
, "medium") == 0) {
858 strcpy(buffer
, face
->weight
);
859 buffer
[0] = toupper(buffer
[0]);
866 if (strcmp(face
->slant
, "r") == 0) {
867 strcat(buffer
, "Roman");
869 } else if (strcmp(face
->slant
, "i") == 0) {
870 strcat(buffer
, "Italic");
871 } else if (strcmp(face
->slant
, "o") == 0) {
872 strcat(buffer
, "Oblique");
873 } else if (strcmp(face
->slant
, "ri") == 0) {
874 strcat(buffer
, "Rev Italic");
875 } else if (strcmp(face
->slant
, "ro") == 0) {
876 strcat(buffer
, "Rev Oblique");
878 strcat(buffer
, face
->slant
);
881 if (buffer
[0] == 0) {
882 strcpy(buffer
, "Normal");
886 fitem
= WMInsertListItem(panel
->typLs
, 0, buffer
);
888 fitem
= WMAddListItem(panel
->typLs
, buffer
);
889 fitem
->clientData
= face
;
893 facei
= WMFindRowOfListItemWithTitle(panel
->typLs
, oface
);
899 WMSelectListItem(panel
->typLs
, facei
);
900 typefaceClick(panel
->typLs
, panel
);
903 sizei
= WMFindRowOfListItemWithTitle(panel
->sizLs
, osize
);
906 WMSelectListItem(panel
->sizLs
, sizei
);
907 sizeClick(panel
->sizLs
, panel
);
919 typefaceClick(WMWidget
*w
, void *data
)
921 FontPanel
*panel
= (FontPanel
*)data
;
931 osize
= WMGetTextFieldText(panel
->sizT
);
934 item
= WMGetListSelectedItem(panel
->typLs
);
935 face
= (Typeface
*)item
->clientData
;
937 WMClearList(panel
->sizLs
);
939 WM_ITERATE_ARRAY(face
->sizes
, size
, i
) {
940 if ((int)size
!= 0) {
941 sprintf(buffer
, "%i", (int)size
);
943 WMAddListItem(panel
->sizLs
, buffer
);
948 sizei
= WMFindRowOfListItemWithTitle(panel
->sizLs
, osize
);
951 sizei
= WMFindRowOfListItemWithTitle(panel
->sizLs
, "12");
956 WMSelectListItem(panel
->sizLs
, sizei
);
957 WMSetListPosition(panel
->sizLs
, sizei
);
958 sizeClick(panel
->sizLs
, panel
);
968 sizeClick(WMWidget
*w
, void *data
)
970 FontPanel
*panel
= (FontPanel
*)data
;
973 item
= WMGetListSelectedItem(panel
->sizLs
);
975 WMSetTextFieldText(panel
->sizT
, item
->text
);
977 WMSelectTextFieldRange(panel
->sizT
, wmkrange(0, strlen(item
->text
)));