13 typedef struct W_FontPanel
{
37 #define MIN_UPPER_HEIGHT 20
38 #define MIN_LOWER_HEIGHT 140
41 #define MAX_FONTS_TO_RETRIEVE 2000
43 #define BUTTON_SPACE_HEIGHT 40
46 #define MIN_HEIGHT (MIN_UPPER_HEIGHT+MIN_LOWER_HEIGHT+BUTTON_SPACE_HEIGHT)
48 #define DEF_UPPER_HEIGHT 60
49 #define DEF_LOWER_HEIGHT 310
52 #define DEF_HEIGHT (DEF_UPPER_HEIGHT+DEF_LOWER_HEIGHT)
57 static int scalableFontSizes
[] = {
74 static void getSelectedFont(FontPanel
*panel
, char buffer
[], int bufsize
);
77 static void arrangeLowerFrame(FontPanel
*panel
);
79 static void familyClick(WMWidget
*, void *);
80 static void typefaceClick(WMWidget
*, void *);
81 static void sizeClick(WMWidget
*, void *);
84 static void listFamilies(WMScreen
*scr
, WMFontPanel
*panel
);
88 splitViewConstrainCallback(WMSplitView
*sPtr
, int indView
, int *min
, int *max
)
91 *min
= MIN_UPPER_HEIGHT
;
93 *min
= MIN_LOWER_HEIGHT
;
97 notificationObserver(void *self
, WMNotification
*notif
)
99 WMFontPanel
*panel
= (WMFontPanel
*)self
;
100 void *object
= WMGetNotificationObject(notif
);
102 if (WMGetNotificationName(notif
) == WMViewSizeDidChangeNotification
) {
103 if (object
== WMWidgetView(panel
->win
)) {
104 int h
= WMWidgetHeight(panel
->win
);
105 int w
= WMWidgetWidth(panel
->win
);
107 WMResizeWidget(panel
->split
, w
, h
-BUTTON_SPACE_HEIGHT
);
109 WMMoveWidget(panel
->setB
, w
-80, h
-(BUTTON_SPACE_HEIGHT
-5));
111 WMMoveWidget(panel
->revertB
, w
-240, h
-(BUTTON_SPACE_HEIGHT
-5));
113 } else if (object
== WMWidgetView(panel
->upperF
)) {
115 if (WMWidgetHeight(panel
->upperF
) < MIN_UPPER_HEIGHT
) {
116 WMResizeWidget(panel
->upperF
, WMWidgetWidth(panel
->upperF
),
119 WMResizeWidget(panel
->sampleT
, WMWidgetWidth(panel
->upperF
)-20,
120 WMWidgetHeight(panel
->upperF
)-10);
123 } else if (object
== WMWidgetView(panel
->lowerF
)) {
125 if (WMWidgetHeight(panel
->lowerF
) < MIN_LOWER_HEIGHT
) {
126 WMResizeWidget(panel
->upperF
, WMWidgetWidth(panel
->upperF
),
129 WMMoveWidget(panel
->lowerF
, 0, WMWidgetHeight(panel
->upperF
)
130 + WMGetSplitViewDividerThickness(panel
->split
));
132 WMResizeWidget(panel
->lowerF
, WMWidgetWidth(panel
->lowerF
),
133 WMWidgetWidth(panel
->split
) - MIN_UPPER_HEIGHT
134 - WMGetSplitViewDividerThickness(panel
->split
));
136 arrangeLowerFrame(panel
);
144 closeWindow(WMWidget
*w
, void *data
)
146 FontPanel
*panel
= (FontPanel
*)data
;
148 WMHideFontPanel(panel
);
154 WMGetFontPanel(WMScreen
*scr
)
157 WMColor
*dark
, *white
;
161 if (scr
->sharedFontPanel
)
162 return scr
->sharedFontPanel
;
165 panel
= wmalloc(sizeof(FontPanel
));
166 memset(panel
, 0, sizeof(FontPanel
));
168 panel
->win
= WMCreateWindow(scr
, "fontPanel");
169 /* WMSetWidgetBackgroundColor(panel->win, WMWhiteColor(scr));*/
170 WMResizeWidget(panel
->win
, DEF_WIDTH
, DEF_HEIGHT
);
171 WMSetWindowMinSize(panel
->win
, MIN_WIDTH
, MIN_HEIGHT
);
172 WMSetViewNotifySizeChanges(WMWidgetView(panel
->win
), True
);
174 WMSetWindowCloseAction(panel
->win
, closeWindow
, panel
);
176 panel
->split
= WMCreateSplitView(panel
->win
);
177 WMResizeWidget(panel
->split
, DEF_WIDTH
, DEF_HEIGHT
- BUTTON_SPACE_HEIGHT
);
178 WMSetSplitViewConstrainProc(panel
->split
, splitViewConstrainCallback
);
180 divThickness
= WMGetSplitViewDividerThickness(panel
->split
);
182 panel
->upperF
= WMCreateFrame(panel
->win
);
183 WMSetFrameRelief(panel
->upperF
, WRFlat
);
184 WMSetViewNotifySizeChanges(WMWidgetView(panel
->upperF
), True
);
185 panel
->lowerF
= WMCreateFrame(panel
->win
);
186 /* WMSetWidgetBackgroundColor(panel->lowerF, WMBlackColor(scr));*/
187 WMSetFrameRelief(panel
->lowerF
, WRFlat
);
188 WMSetViewNotifySizeChanges(WMWidgetView(panel
->lowerF
), True
);
190 WMAddSplitViewSubview(panel
->split
, W_VIEW(panel
->upperF
));
191 WMAddSplitViewSubview(panel
->split
, W_VIEW(panel
->lowerF
));
193 WMResizeWidget(panel
->upperF
, DEF_WIDTH
, DEF_UPPER_HEIGHT
);
195 WMResizeWidget(panel
->lowerF
, DEF_WIDTH
, DEF_LOWER_HEIGHT
);
197 WMMoveWidget(panel
->lowerF
, 0, 60+divThickness
);
199 white
= WMWhiteColor(scr
);
200 dark
= WMDarkGrayColor(scr
);
202 panel
->sampleT
= WMCreateTextField(panel
->upperF
);
203 WMResizeWidget(panel
->sampleT
, DEF_WIDTH
- 20, 50);
204 WMMoveWidget(panel
->sampleT
, 10, 10);
205 WMSetTextFieldText(panel
->sampleT
, _("Test!!!"));
207 font
= WMBoldSystemFontOfSize(scr
, 12);
209 panel
->famL
= WMCreateLabel(panel
->lowerF
);
210 WMSetWidgetBackgroundColor(panel
->famL
, dark
);
211 WMSetLabelText(panel
->famL
, _("Family"));
212 WMSetLabelFont(panel
->famL
, font
);
213 WMSetLabelTextColor(panel
->famL
, white
);
214 WMSetLabelRelief(panel
->famL
, WRSunken
);
215 WMSetLabelTextAlignment(panel
->famL
, WACenter
);
217 panel
->famLs
= WMCreateList(panel
->lowerF
);
218 WMSetListAction(panel
->famLs
, familyClick
, panel
);
220 panel
->typL
= WMCreateLabel(panel
->lowerF
);
221 WMSetWidgetBackgroundColor(panel
->typL
, dark
);
222 WMSetLabelText(panel
->typL
, _("Typeface"));
223 WMSetLabelFont(panel
->typL
, font
);
224 WMSetLabelTextColor(panel
->typL
, white
);
225 WMSetLabelRelief(panel
->typL
, WRSunken
);
226 WMSetLabelTextAlignment(panel
->typL
, WACenter
);
228 panel
->typLs
= WMCreateList(panel
->lowerF
);
229 WMSetListAction(panel
->typLs
, typefaceClick
, panel
);
231 panel
->sizL
= WMCreateLabel(panel
->lowerF
);
232 WMSetWidgetBackgroundColor(panel
->sizL
, dark
);
233 WMSetLabelText(panel
->sizL
, _("Size"));
234 WMSetLabelFont(panel
->sizL
, font
);
235 WMSetLabelTextColor(panel
->sizL
, white
);
236 WMSetLabelRelief(panel
->sizL
, WRSunken
);
237 WMSetLabelTextAlignment(panel
->sizL
, WACenter
);
239 panel
->sizT
= WMCreateTextField(panel
->lowerF
);
240 /* WMSetTextFieldAlignment(panel->sizT, WARight);*/
242 panel
->sizLs
= WMCreateList(panel
->lowerF
);
243 WMSetListAction(panel
->sizLs
, sizeClick
, panel
);
246 WMReleaseColor(white
);
247 WMReleaseColor(dark
);
249 panel
->setB
= WMCreateCommandButton(panel
->win
);
250 WMResizeWidget(panel
->setB
, 70, 24);
251 WMMoveWidget(panel
->setB
, 240, DEF_HEIGHT
- (BUTTON_SPACE_HEIGHT
-5));
252 WMSetButtonText(panel
->setB
, _("Set"));
254 panel
->revertB
= WMCreateCommandButton(panel
->win
);
255 WMResizeWidget(panel
->revertB
, 70, 24);
256 WMMoveWidget(panel
->revertB
, 80, DEF_HEIGHT
- (BUTTON_SPACE_HEIGHT
-5));
257 WMSetButtonText(panel
->revertB
, _("Revert"));
259 WMRealizeWidget(panel
->win
);
261 WMMapSubwidgets(panel
->upperF
);
262 WMMapSubwidgets(panel
->lowerF
);
263 WMMapSubwidgets(panel
->split
);
264 WMMapSubwidgets(panel
->win
);
266 WMUnmapWidget(panel
->revertB
);
268 arrangeLowerFrame(panel
);
270 scr
->sharedFontPanel
= panel
;
273 /* register notification observers */
274 WMAddNotificationObserver(notificationObserver
, panel
,
275 WMViewSizeDidChangeNotification
,
276 WMWidgetView(panel
->win
));
277 WMAddNotificationObserver(notificationObserver
, panel
,
278 WMViewSizeDidChangeNotification
,
279 WMWidgetView(panel
->upperF
));
280 WMAddNotificationObserver(notificationObserver
, panel
,
281 WMViewSizeDidChangeNotification
,
282 WMWidgetView(panel
->lowerF
));
285 listFamilies(scr
, panel
);
293 WMFreeFontPanel(WMFontPanel
*panel
)
295 if (panel
== WMWidgetScreen(panel
->win
)->sharedFontPanel
) {
296 WMWidgetScreen(panel
->win
)->sharedFontPanel
= NULL
;
298 WMRemoveNotificationObserver(panel
);
299 WMUnmapWidget(panel
->win
);
300 WMDestroyWidget(panel
->win
);
306 WMShowFontPanel(WMFontPanel
*panel
)
308 WMMapWidget(panel
->win
);
313 WMHideFontPanel(WMFontPanel
*panel
)
315 WMUnmapWidget(panel
->win
);
320 WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
)
327 WMSetFontPanelFontName(WMFontPanel
*panel
, char *fontName
)
335 WMGetFontPanelFont(WMFontPanel
*panel
)
337 return WMGetTextFieldFont(panel
->sampleT
);
342 WMGetFontPanelFontName(WMFontPanel
*panel
)
346 getSelectedFont(panel
, name
, sizeof(name
));
348 return wstrdup(name
);
354 arrangeLowerFrame(FontPanel
*panel
)
356 int width
= WMWidgetWidth(panel
->lowerF
) - 55 - 30;
357 int height
= WMWidgetHeight(panel
->split
) - WMWidgetHeight(panel
->upperF
);
360 #define LABEL_HEIGHT 20
362 height
-= WMGetSplitViewDividerThickness(panel
->split
);
365 height
-= LABEL_HEIGHT
+ 8;
367 fw
= (125*width
) / 235;
368 tw
= (110*width
) / 235;
371 WMMoveWidget(panel
->famL
, 10, 0);
372 WMResizeWidget(panel
->famL
, fw
, LABEL_HEIGHT
);
374 WMMoveWidget(panel
->famLs
, 10, 23);
375 WMResizeWidget(panel
->famLs
, fw
, height
);
377 WMMoveWidget(panel
->typL
, 10+fw
+3, 0);
378 WMResizeWidget(panel
->typL
, tw
, LABEL_HEIGHT
);
380 WMMoveWidget(panel
->typLs
, 10+fw
+3, 23);
381 WMResizeWidget(panel
->typLs
, tw
, height
);
383 WMMoveWidget(panel
->sizL
, 10+fw
+3+tw
+3, 0);
384 WMResizeWidget(panel
->sizL
, sw
+4, LABEL_HEIGHT
);
386 WMMoveWidget(panel
->sizT
, 10+fw
+3+tw
+3, 23);
387 WMResizeWidget(panel
->sizT
, sw
+4, 20);
389 WMMoveWidget(panel
->sizLs
, 10+fw
+3+tw
+3, 46);
390 WMResizeWidget(panel
->sizLs
, sw
+4, height
-23);
396 #define ALL_FONTS_MASK "-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
413 #define NUM_FIELDS 14
418 parseFont(char *font
, char values
[NUM_FIELDS
][256])
422 char buffer
[256], *bptr
;
426 ptr
++; /* skip first - */
431 strcpy(values
[part
], buffer
);
440 strcpy(values
[part
], buffer
);
448 isXLFD(char *font
, int *length_ret
)
459 return c
==NUM_FIELDS
;
472 char showSetWidth
; /* when duplicated */
473 char showAddStyle
; /* when duplicated */
483 char *registry
, *encoding
;
485 char showFoundry
; /* when duplicated */
486 char showRegistry
; /* when duplicated */
495 compare_int(const void *a
, const void *b
)
511 addSizeToTypeface(Typeface
*face
, int size
)
516 for (j
= 0; j
< sizeof(scalableFontSizes
)/sizeof(int); j
++) {
517 size
= scalableFontSizes
[j
];
519 if (!WMCountInArray(face
->sizes
, (void*)size
)) {
520 WMAddToArray(face
->sizes
, (void*)size
);
523 WMSortArray(face
->sizes
, compare_int
);
525 if (!WMCountInArray(face
->sizes
, (void*)size
)) {
526 WMAddToArray(face
->sizes
, (void*)size
);
527 WMSortArray(face
->sizes
, compare_int
);
535 addTypefaceToFamily(Family
*family
, char fontFields
[NUM_FIELDS
][256])
540 if (family
->typefaces
) {
541 WM_ITERATE_ARRAY(family
->typefaces
, face
, i
) {
544 if (strcmp(face
->weight
, fontFields
[WEIGHT
]) != 0) {
547 if (strcmp(face
->slant
, fontFields
[SLANT
]) != 0) {
551 size
= atoi(fontFields
[PIXEL_SIZE
]);
553 addSizeToTypeface(face
, size
);
558 family
->typefaces
= WMCreateArray(4);
561 face
= wmalloc(sizeof(Typeface
));
562 memset(face
, 0, sizeof(Typeface
));
564 face
->weight
= wstrdup(fontFields
[WEIGHT
]);
565 face
->slant
= wstrdup(fontFields
[SLANT
]);
566 face
->setWidth
= wstrdup(fontFields
[SETWIDTH
]);
567 face
->addStyle
= wstrdup(fontFields
[ADD_STYLE
]);
569 face
->sizes
= WMCreateArray(4);
570 addSizeToTypeface(face
, atoi(fontFields
[PIXEL_SIZE
]));
572 WMAddToArray(family
->typefaces
, face
);
578 * families (same family name) (Hashtable of family -> array)
579 * registries (same family but different registries)
584 addFontToFamily(WMHashTable
*families
, char fontFields
[NUM_FIELDS
][256])
591 family
= WMHashGet(families
, fontFields
[FAMILY
]);
594 /* look for same encoding/registry and foundry */
595 WM_ITERATE_ARRAY(family
, fam
, i
) {
598 enc
= (strcmp(fam
->encoding
, fontFields
[ENCODING
]) == 0);
599 reg
= (strcmp(fam
->registry
, fontFields
[REGISTRY
]) == 0);
600 found
= (strcmp(fam
->foundry
, fontFields
[FOUNDRY
]) == 0);
602 if (enc
&& reg
&& found
) {
603 addTypefaceToFamily(fam
, fontFields
);
607 /* look for same encoding/registry */
608 WM_ITERATE_ARRAY(family
, fam
, i
) {
611 enc
= (strcmp(fam
->encoding
, fontFields
[ENCODING
]) == 0);
612 reg
= (strcmp(fam
->registry
, fontFields
[REGISTRY
]) == 0);
615 /* has the same encoding, but the foundry is different */
616 fam
->showFoundry
= 1;
618 fam
= wmalloc(sizeof(Family
));
619 memset(fam
, 0, sizeof(Family
));
621 fam
->name
= wstrdup(fontFields
[FAMILY
]);
622 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
623 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
624 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
625 fam
->showFoundry
= 1;
627 addTypefaceToFamily(fam
, fontFields
);
629 WMAddToArray(family
, fam
);
633 /* look for same foundry */
634 WM_ITERATE_ARRAY(family
, fam
, i
) {
637 found
= (strcmp(fam
->foundry
, fontFields
[FOUNDRY
]) == 0);
640 /* has the same foundry, but encoding is different */
641 fam
->showRegistry
= 1;
643 fam
= wmalloc(sizeof(Family
));
644 memset(fam
, 0, sizeof(Family
));
646 fam
->name
= wstrdup(fontFields
[FAMILY
]);
647 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
648 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
649 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
650 fam
->showRegistry
= 1;
652 addTypefaceToFamily(fam
, fontFields
);
654 WMAddToArray(family
, fam
);
658 /* foundry and encoding do not match anything known */
659 fam
= wmalloc(sizeof(Family
));
660 memset(fam
, 0, sizeof(Family
));
662 fam
->name
= wstrdup(fontFields
[FAMILY
]);
663 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
664 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
665 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
666 fam
->showFoundry
= 1;
667 fam
->showRegistry
= 1;
669 addTypefaceToFamily(fam
, fontFields
);
671 WMAddToArray(family
, fam
);
675 family
= WMCreateArray(8);
677 fam
= wmalloc(sizeof(Family
));
678 memset(fam
, 0, sizeof(Family
));
680 fam
->name
= wstrdup(fontFields
[FAMILY
]);
681 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
682 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
683 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
685 addTypefaceToFamily(fam
, fontFields
);
687 WMAddToArray(family
, fam
);
689 WMHashInsert(families
, fam
->name
, family
);
695 listFamilies(WMScreen
*scr
, WMFontPanel
*panel
)
700 WMHashTable
*families
= WMCreateHashTable(WMStringPointerHashCallbacks
);
701 char fields
[NUM_FIELDS
][256];
702 WMHashEnumerator enumer
;
705 fontList
= XListFonts(scr
->display
, ALL_FONTS_MASK
, MAX_FONTS_TO_RETRIEVE
,
708 WMRunAlertPanel(scr
, panel
->win
, _("Error"),
709 _("Could not retrieve font list"), _("OK"), NULL
, NULL
);
713 for (i
= 0; i
< count
; i
++) {
716 if (!isXLFD(fontList
[i
], &fname_len
)) {
720 if (fname_len
> 255) {
721 wwarning(_("font name %s is longer than 256, which is invalid."),
726 if (!parseFont(fontList
[i
], fields
)) {
730 addFontToFamily(families
, fields
);
733 enumer
= WMEnumerateHashTable(families
);
735 while ((array
= WMNextHashEnumeratorItem(&enumer
))) {
741 WM_ITERATE_ARRAY(array
, fam
, i
) {
742 strcpy(buffer
, fam
->name
);
744 if (fam
->showFoundry
) {
746 strcat(buffer
, fam
->foundry
);
749 if (fam
->showRegistry
) {
750 strcat(buffer
, " (");
751 strcat(buffer
, fam
->registry
);
753 strcat(buffer
, fam
->encoding
);
756 item
= WMAddListItem(panel
->famLs
, buffer
);
758 item
->clientData
= fam
;
760 /* Isn't this going to memleak since items weren't released? --Dan */
763 WMSortListItems(panel
->famLs
);
765 WMFreeHashTable(families
);
770 getSelectedFont(FontPanel
*panel
, char buffer
[], int bufsize
)
778 item
= WMGetListSelectedItem(panel
->famLs
);
781 family
= (Family
*)item
->clientData
;
783 item
= WMGetListSelectedItem(panel
->typLs
);
786 face
= (Typeface
*)item
->clientData
;
788 size
= WMGetTextFieldText(panel
->sizT
);
790 snprintf(buffer
, bufsize
, "-%s-%s-%s-%s-%s-%s-%s-*-*-*-*-*-%s-%s",
805 preview(FontPanel
*panel
)
810 getSelectedFont(panel
, buffer
, sizeof(buffer
));
812 font
= WMCreateFont(WMWidgetScreen(panel
->win
), buffer
);
814 WMSetTextFieldFont(panel
->sampleT
, font
);
822 familyClick(WMWidget
*w
, void *data
)
824 WMList
*lPtr
= (WMList
*)w
;
827 FontPanel
*panel
= (FontPanel
*)data
;
830 /* current typeface and size */
836 /* must try to keep the same typeface and size for the new family */
837 item
= WMGetListSelectedItem(panel
->typLs
);
839 oface
= wstrdup(item
->text
);
841 osize
= WMGetTextFieldText(panel
->sizT
);
844 item
= WMGetListSelectedItem(lPtr
);
845 family
= (Family
*)item
->clientData
;
847 WMClearList(panel
->typLs
);
850 WM_ITERATE_ARRAY(family
->typefaces
, face
, i
) {
855 if (strcmp(face
->weight
, "medium") == 0) {
859 strcpy(buffer
, face
->weight
);
860 buffer
[0] = toupper(buffer
[0]);
867 if (strcmp(face
->slant
, "r") == 0) {
868 strcat(buffer
, _("Roman"));
870 } else if (strcmp(face
->slant
, "i") == 0) {
871 strcat(buffer
, _("Italic"));
872 } else if (strcmp(face
->slant
, "o") == 0) {
873 strcat(buffer
, _("Oblique"));
874 } else if (strcmp(face
->slant
, "ri") == 0) {
875 strcat(buffer
, _("Rev Italic"));
876 } else if (strcmp(face
->slant
, "ro") == 0) {
877 strcat(buffer
, _("Rev Oblique"));
879 strcat(buffer
, face
->slant
);
882 if (buffer
[0] == 0) {
883 strcpy(buffer
, _("Normal"));
887 fitem
= WMInsertListItem(panel
->typLs
, 0, buffer
);
889 fitem
= WMAddListItem(panel
->typLs
, buffer
);
890 fitem
->clientData
= face
;
894 facei
= WMFindRowOfListItemWithTitle(panel
->typLs
, oface
);
900 WMSelectListItem(panel
->typLs
, facei
);
901 typefaceClick(panel
->typLs
, panel
);
904 sizei
= WMFindRowOfListItemWithTitle(panel
->sizLs
, osize
);
907 WMSelectListItem(panel
->sizLs
, sizei
);
908 sizeClick(panel
->sizLs
, panel
);
920 typefaceClick(WMWidget
*w
, void *data
)
922 FontPanel
*panel
= (FontPanel
*)data
;
932 osize
= WMGetTextFieldText(panel
->sizT
);
935 item
= WMGetListSelectedItem(panel
->typLs
);
936 face
= (Typeface
*)item
->clientData
;
938 WMClearList(panel
->sizLs
);
940 WM_ITERATE_ARRAY(face
->sizes
, size
, i
) {
941 if ((int)size
!= 0) {
942 sprintf(buffer
, "%i", (int)size
);
944 WMAddListItem(panel
->sizLs
, buffer
);
949 sizei
= WMFindRowOfListItemWithTitle(panel
->sizLs
, osize
);
952 sizei
= WMFindRowOfListItemWithTitle(panel
->sizLs
, "12");
957 WMSelectListItem(panel
->sizLs
, sizei
);
958 WMSetListPosition(panel
->sizLs
, sizei
);
959 sizeClick(panel
->sizLs
, panel
);
969 sizeClick(WMWidget
*w
, void *data
)
971 FontPanel
*panel
= (FontPanel
*)data
;
974 item
= WMGetListSelectedItem(panel
->sizLs
);
976 WMSetTextFieldText(panel
->sizT
, item
->text
);
978 WMSelectTextFieldRange(panel
->sizT
, wmkrange(0, strlen(item
->text
)));