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
);
86 splitViewConstrainCallback(WMSplitView
*sPtr
, int divIndex
, int *min
, int *max
)
88 *min
= MIN_UPPER_HEIGHT
;
89 *max
= WMWidgetHeight(sPtr
)-BUTTON_SPACE_HEIGHT
-MIN_LOWER_HEIGHT
;
94 notificationObserver(void *self
, WMNotification
*notif
)
96 WMFontPanel
*panel
= (WMFontPanel
*)self
;
97 void *object
= WMGetNotificationObject(notif
);
99 if (WMGetNotificationName(notif
) == WMViewSizeDidChangeNotification
) {
100 if (object
== WMWidgetView(panel
->win
)) {
101 int h
= WMWidgetHeight(panel
->win
);
102 int w
= WMWidgetWidth(panel
->win
);
104 WMResizeWidget(panel
->split
, w
, h
-BUTTON_SPACE_HEIGHT
);
106 WMMoveWidget(panel
->setB
, w
-80, h
-(BUTTON_SPACE_HEIGHT
-5));
108 WMMoveWidget(panel
->revertB
, w
-240, h
-(BUTTON_SPACE_HEIGHT
-5));
110 } else if (object
== WMWidgetView(panel
->upperF
)) {
112 if (WMWidgetHeight(panel
->upperF
) < MIN_UPPER_HEIGHT
) {
113 WMResizeWidget(panel
->upperF
, WMWidgetWidth(panel
->upperF
),
116 WMResizeWidget(panel
->sampleT
, WMWidgetWidth(panel
->upperF
)-20,
117 WMWidgetHeight(panel
->upperF
)-10);
120 } else if (object
== WMWidgetView(panel
->lowerF
)) {
122 if (WMWidgetHeight(panel
->lowerF
) < MIN_LOWER_HEIGHT
) {
123 WMResizeWidget(panel
->upperF
, WMWidgetWidth(panel
->upperF
),
126 WMMoveWidget(panel
->lowerF
, 0, WMWidgetHeight(panel
->upperF
)
127 + WMGetSplitViewDividerThickness(panel
->split
));
129 WMResizeWidget(panel
->lowerF
, WMWidgetWidth(panel
->lowerF
),
130 WMWidgetWidth(panel
->split
) - MIN_UPPER_HEIGHT
131 - WMGetSplitViewDividerThickness(panel
->split
));
133 arrangeLowerFrame(panel
);
141 WMGetFontPanel(WMScreen
*scr
)
144 WMColor
*dark
, *white
;
148 if (scr
->sharedFontPanel
)
149 return scr
->sharedFontPanel
;
152 panel
= wmalloc(sizeof(FontPanel
));
153 memset(panel
, 0, sizeof(FontPanel
));
155 panel
->win
= WMCreateWindow(scr
, "fontPanel");
156 /* WMSetWidgetBackgroundColor(panel->win, WMWhiteColor(scr));*/
157 WMResizeWidget(panel
->win
, DEF_WIDTH
, DEF_HEIGHT
);
158 WMSetWindowMinSize(panel
->win
, MIN_WIDTH
, MIN_HEIGHT
);
159 WMSetViewNotifySizeChanges(WMWidgetView(panel
->win
), True
);
161 panel
->split
= WMCreateSplitView(panel
->win
);
162 WMResizeWidget(panel
->split
, DEF_WIDTH
, DEF_HEIGHT
- BUTTON_SPACE_HEIGHT
);
163 WMSetSplitViewConstrainProc(panel
->split
, splitViewConstrainCallback
);
165 divThickness
= WMGetSplitViewDividerThickness(panel
->split
);
167 panel
->upperF
= WMCreateFrame(panel
->win
);
168 WMSetFrameRelief(panel
->upperF
, WRFlat
);
169 WMSetViewNotifySizeChanges(WMWidgetView(panel
->upperF
), True
);
170 panel
->lowerF
= WMCreateFrame(panel
->win
);
171 /* WMSetWidgetBackgroundColor(panel->lowerF, WMBlackColor(scr));*/
172 WMSetFrameRelief(panel
->lowerF
, WRFlat
);
173 WMSetViewNotifySizeChanges(WMWidgetView(panel
->lowerF
), True
);
175 WMAddSplitViewSubview(panel
->split
, W_VIEW(panel
->upperF
));
176 WMAddSplitViewSubview(panel
->split
, W_VIEW(panel
->lowerF
));
178 WMResizeWidget(panel
->upperF
, DEF_WIDTH
, DEF_UPPER_HEIGHT
);
180 WMResizeWidget(panel
->lowerF
, DEF_WIDTH
, DEF_LOWER_HEIGHT
);
182 WMMoveWidget(panel
->lowerF
, 0, 60+divThickness
);
184 white
= WMWhiteColor(scr
);
185 dark
= WMDarkGrayColor(scr
);
187 panel
->sampleT
= WMCreateTextField(panel
->upperF
);
188 WMResizeWidget(panel
->sampleT
, DEF_WIDTH
- 20, 50);
189 WMMoveWidget(panel
->sampleT
, 10, 10);
190 WMSetTextFieldText(panel
->sampleT
, "Test!!!");
192 font
= WMBoldSystemFontOfSize(scr
, 12);
194 panel
->famL
= WMCreateLabel(panel
->lowerF
);
195 WMSetWidgetBackgroundColor(panel
->famL
, dark
);
196 WMSetLabelText(panel
->famL
, "Family");
197 WMSetLabelFont(panel
->famL
, font
);
198 WMSetLabelTextColor(panel
->famL
, white
);
199 WMSetLabelRelief(panel
->famL
, WRSunken
);
200 WMSetLabelTextAlignment(panel
->famL
, WACenter
);
202 panel
->famLs
= WMCreateList(panel
->lowerF
);
203 WMSetListAction(panel
->famLs
, familyClick
, panel
);
205 panel
->typL
= WMCreateLabel(panel
->lowerF
);
206 WMSetWidgetBackgroundColor(panel
->typL
, dark
);
207 WMSetLabelText(panel
->typL
, "Typeface");
208 WMSetLabelFont(panel
->typL
, font
);
209 WMSetLabelTextColor(panel
->typL
, white
);
210 WMSetLabelRelief(panel
->typL
, WRSunken
);
211 WMSetLabelTextAlignment(panel
->typL
, WACenter
);
213 panel
->typLs
= WMCreateList(panel
->lowerF
);
214 WMSetListAction(panel
->typLs
, typefaceClick
, panel
);
216 panel
->sizL
= WMCreateLabel(panel
->lowerF
);
217 WMSetWidgetBackgroundColor(panel
->sizL
, dark
);
218 WMSetLabelText(panel
->sizL
, "Size");
219 WMSetLabelFont(panel
->sizL
, font
);
220 WMSetLabelTextColor(panel
->sizL
, white
);
221 WMSetLabelRelief(panel
->sizL
, WRSunken
);
222 WMSetLabelTextAlignment(panel
->sizL
, WACenter
);
224 panel
->sizT
= WMCreateTextField(panel
->lowerF
);
225 /* WMSetTextFieldAlignment(panel->sizT, WARight);*/
227 panel
->sizLs
= WMCreateList(panel
->lowerF
);
228 WMSetListAction(panel
->sizLs
, sizeClick
, panel
);
231 WMReleaseColor(white
);
232 WMReleaseColor(dark
);
234 panel
->setB
= WMCreateCommandButton(panel
->win
);
235 WMResizeWidget(panel
->setB
, 70, 24);
236 WMMoveWidget(panel
->setB
, 240, DEF_HEIGHT
- (BUTTON_SPACE_HEIGHT
-5));
237 WMSetButtonText(panel
->setB
, "Set");
239 panel
->revertB
= WMCreateCommandButton(panel
->win
);
240 WMResizeWidget(panel
->revertB
, 70, 24);
241 WMMoveWidget(panel
->revertB
, 80, DEF_HEIGHT
- (BUTTON_SPACE_HEIGHT
-5));
242 WMSetButtonText(panel
->revertB
, "Revert");
244 WMRealizeWidget(panel
->win
);
246 WMMapSubwidgets(panel
->upperF
);
247 WMMapSubwidgets(panel
->lowerF
);
248 WMMapSubwidgets(panel
->split
);
249 WMMapSubwidgets(panel
->win
);
251 WMUnmapWidget(panel
->revertB
);
253 arrangeLowerFrame(panel
);
255 scr
->sharedFontPanel
= panel
;
258 /* register notification observers */
259 WMAddNotificationObserver(notificationObserver
, panel
,
260 WMViewSizeDidChangeNotification
,
261 WMWidgetView(panel
->win
));
262 WMAddNotificationObserver(notificationObserver
, panel
,
263 WMViewSizeDidChangeNotification
,
264 WMWidgetView(panel
->upperF
));
265 WMAddNotificationObserver(notificationObserver
, panel
,
266 WMViewSizeDidChangeNotification
,
267 WMWidgetView(panel
->lowerF
));
270 listFamilies(scr
, panel
);
278 WMFreeFontPanel(WMFontPanel
*panel
)
280 if (panel
== WMWidgetScreen(panel
->win
)->sharedFontPanel
) {
281 WMWidgetScreen(panel
->win
)->sharedFontPanel
= NULL
;
283 WMRemoveNotificationObserver(panel
);
284 WMUnmapWidget(panel
->win
);
285 WMDestroyWidget(panel
->win
);
291 WMShowFontPanel(WMFontPanel
*panel
)
293 WMMapWidget(panel
->win
);
298 WMHideFontPanel(WMFontPanel
*panel
)
300 WMUnmapWidget(panel
->win
);
305 WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
)
312 WMSetFontPanelFontName(WMFontPanel
*panel
, char *fontName
)
320 WMGetFontPanelFont(WMFontPanel
*panel
)
322 return WMGetTextFieldFont(panel
->sampleT
);
327 WMGetFontPanelFontName(WMFontPanel
*panel
)
331 getSelectedFont(panel
, name
);
333 return wstrdup(name
);
339 arrangeLowerFrame(FontPanel
*panel
)
341 int width
= WMWidgetWidth(panel
->lowerF
) - 55 - 30;
342 int height
= WMWidgetHeight(panel
->split
) - WMWidgetHeight(panel
->upperF
);
345 #define LABEL_HEIGHT 20
347 height
-= WMGetSplitViewDividerThickness(panel
->split
);
350 height
-= LABEL_HEIGHT
+ 8;
352 fw
= (125*width
) / 235;
353 tw
= (110*width
) / 235;
356 WMMoveWidget(panel
->famL
, 10, 0);
357 WMResizeWidget(panel
->famL
, fw
, LABEL_HEIGHT
);
359 WMMoveWidget(panel
->famLs
, 10, 23);
360 WMResizeWidget(panel
->famLs
, fw
, height
);
362 WMMoveWidget(panel
->typL
, 10+fw
+3, 0);
363 WMResizeWidget(panel
->typL
, tw
, LABEL_HEIGHT
);
365 WMMoveWidget(panel
->typLs
, 10+fw
+3, 23);
366 WMResizeWidget(panel
->typLs
, tw
, height
);
368 WMMoveWidget(panel
->sizL
, 10+fw
+3+tw
+3, 0);
369 WMResizeWidget(panel
->sizL
, sw
+4, LABEL_HEIGHT
);
371 WMMoveWidget(panel
->sizT
, 10+fw
+3+tw
+3, 23);
372 WMResizeWidget(panel
->sizT
, sw
+4, 20);
374 WMMoveWidget(panel
->sizLs
, 10+fw
+3+tw
+3, 46);
375 WMResizeWidget(panel
->sizLs
, sw
+4, height
-23);
381 #define ALL_FONTS_MASK "-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
398 #define NUM_FIELDS 14
403 parseFont(char *font
, char values
[NUM_FIELDS
][256])
407 char buffer
[256], *bptr
;
411 ptr
++; /* skip first - */
416 strcpy(values
[part
], buffer
);
425 strcpy(values
[part
], buffer
);
433 isXLFD(char *font
, int *length_ret
)
444 return c
==NUM_FIELDS
;
457 char showSetWidth
; /* when duplicated */
458 char showAddStyle
; /* when duplicated */
468 char *registry
, *encoding
;
470 char showFoundry
; /* when duplicated */
471 char showRegistry
; /* when duplicated */
480 compare_int(const void *a
, const void *b
)
496 addSizeToTypeface(Typeface
*face
, int size
)
501 for (j
= 0; j
< sizeof(scalableFontSizes
)/sizeof(int); j
++) {
502 size
= scalableFontSizes
[j
];
504 if (!WMCountInBag(face
->sizes
, (void*)size
)) {
505 WMPutInBag(face
->sizes
, (void*)size
);
508 WMSortBag(face
->sizes
, compare_int
);
510 if (!WMCountInBag(face
->sizes
, (void*)size
)) {
511 WMPutInBag(face
->sizes
, (void*)size
);
512 WMSortBag(face
->sizes
, compare_int
);
520 addTypefaceToFamily(Family
*family
, char fontFields
[NUM_FIELDS
][256])
525 if (family
->typefaces
) {
526 for (i
= 0; i
< WMGetBagItemCount(family
->typefaces
); i
++) {
529 face
= WMGetFromBag(family
->typefaces
, i
);
531 if (strcmp(face
->weight
, fontFields
[WEIGHT
]) != 0) {
534 if (strcmp(face
->slant
, fontFields
[SLANT
]) != 0) {
538 size
= atoi(fontFields
[PIXEL_SIZE
]);
540 addSizeToTypeface(face
, size
);
545 family
->typefaces
= WMCreateBag(4);
548 face
= wmalloc(sizeof(Typeface
));
549 memset(face
, 0, sizeof(Typeface
));
551 face
->weight
= wstrdup(fontFields
[WEIGHT
]);
552 face
->slant
= wstrdup(fontFields
[SLANT
]);
553 face
->setWidth
= wstrdup(fontFields
[SETWIDTH
]);
554 face
->addStyle
= wstrdup(fontFields
[ADD_STYLE
]);
556 face
->sizes
= WMCreateBag(4);
557 addSizeToTypeface(face
, atoi(fontFields
[PIXEL_SIZE
]));
559 WMPutInBag(family
->typefaces
, face
);
565 * families (same family name) (Hashtable of family -> bag)
566 * registries (same family but different registries)
571 addFontToFamily(WMHashTable
*families
, char fontFields
[NUM_FIELDS
][256])
578 family
= WMHashGet(families
, fontFields
[FAMILY
]);
581 /* look for same encoding/registry and foundry */
582 for (i
= 0; i
< WMGetBagItemCount(family
); i
++) {
585 fam
= WMGetFromBag(family
, i
);
587 enc
= (strcmp(fam
->encoding
, fontFields
[ENCODING
]) == 0);
588 reg
= (strcmp(fam
->registry
, fontFields
[REGISTRY
]) == 0);
589 found
= (strcmp(fam
->foundry
, fontFields
[FOUNDRY
]) == 0);
591 if (enc
&& reg
&& found
) {
592 addTypefaceToFamily(fam
, fontFields
);
596 /* look for same encoding/registry */
597 for (i
= 0; i
< WMGetBagItemCount(family
); i
++) {
600 fam
= WMGetFromBag(family
, i
);
602 enc
= (strcmp(fam
->encoding
, fontFields
[ENCODING
]) == 0);
603 reg
= (strcmp(fam
->registry
, fontFields
[REGISTRY
]) == 0);
606 /* has the same encoding, but the foundry is different */
607 fam
->showFoundry
= 1;
609 fam
= wmalloc(sizeof(Family
));
610 memset(fam
, 0, sizeof(Family
));
612 fam
->name
= wstrdup(fontFields
[FAMILY
]);
613 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
614 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
615 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
616 fam
->showFoundry
= 1;
618 addTypefaceToFamily(fam
, fontFields
);
620 WMPutInBag(family
, fam
);
624 /* look for same foundry */
625 for (i
= 0; i
< WMGetBagItemCount(family
); i
++) {
628 fam
= WMGetFromBag(family
, i
);
630 found
= (strcmp(fam
->foundry
, fontFields
[FOUNDRY
]) == 0);
633 /* has the same foundry, but encoding is different */
634 fam
->showRegistry
= 1;
636 fam
= wmalloc(sizeof(Family
));
637 memset(fam
, 0, sizeof(Family
));
639 fam
->name
= wstrdup(fontFields
[FAMILY
]);
640 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
641 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
642 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
643 fam
->showRegistry
= 1;
645 addTypefaceToFamily(fam
, fontFields
);
647 WMPutInBag(family
, fam
);
651 /* foundry and encoding do not match anything known */
652 fam
= wmalloc(sizeof(Family
));
653 memset(fam
, 0, sizeof(Family
));
655 fam
->name
= wstrdup(fontFields
[FAMILY
]);
656 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
657 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
658 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
659 fam
->showFoundry
= 1;
660 fam
->showRegistry
= 1;
662 addTypefaceToFamily(fam
, fontFields
);
664 WMPutInBag(family
, fam
);
668 family
= WMCreateBag(8);
670 fam
= wmalloc(sizeof(Family
));
671 memset(fam
, 0, sizeof(Family
));
673 fam
->name
= wstrdup(fontFields
[FAMILY
]);
674 fam
->foundry
= wstrdup(fontFields
[FOUNDRY
]);
675 fam
->registry
= wstrdup(fontFields
[REGISTRY
]);
676 fam
->encoding
= wstrdup(fontFields
[ENCODING
]);
678 addTypefaceToFamily(fam
, fontFields
);
680 WMPutInBag(family
, fam
);
682 WMHashInsert(families
, fam
->name
, family
);
688 listFamilies(WMScreen
*scr
, WMFontPanel
*panel
)
693 WMHashTable
*families
= WMCreateHashTable(WMStringPointerHashCallbacks
);
694 char fields
[NUM_FIELDS
][256];
695 WMHashEnumerator enumer
;
698 fontList
= XListFonts(scr
->display
, ALL_FONTS_MASK
, MAX_FONTS_TO_RETRIEVE
,
701 WMRunAlertPanel(scr
, panel
->win
, "Error",
702 "Could not retrieve font list", "OK", NULL
, NULL
);
706 for (i
= 0; i
< count
; i
++) {
709 if (!isXLFD(fontList
[i
], &fname_len
)) {
713 if (fname_len
> 255) {
714 wwarning("font name %s is longer than 256, which is invalid.",
719 if (!parseFont(fontList
[i
], fields
)) {
723 addFontToFamily(families
, fields
);
726 enumer
= WMEnumerateHashTable(families
);
728 while ((bag
= WMNextHashEnumeratorItem(&enumer
))) {
734 for (i
= 0; i
< WMGetBagItemCount(bag
); i
++) {
735 fam
= WMGetFromBag(bag
, i
);
737 strcpy(buffer
, fam
->name
);
739 if (fam
->showFoundry
) {
741 strcat(buffer
, fam
->foundry
);
744 if (fam
->showRegistry
) {
745 strcat(buffer
, " (");
746 strcat(buffer
, fam
->registry
);
748 strcat(buffer
, fam
->encoding
);
751 item
= WMAddSortedListItem(panel
->famLs
, buffer
);
753 item
->clientData
= fam
;
758 WMFreeHashTable(families
);
763 getSelectedFont(FontPanel
*panel
, char buffer
[])
771 item
= WMGetListSelectedItem(panel
->famLs
);
774 family
= (Family
*)item
->clientData
;
776 item
= WMGetListSelectedItem(panel
->typLs
);
779 face
= (Typeface
*)item
->clientData
;
781 size
= WMGetTextFieldText(panel
->sizT
);
783 sprintf(buffer
, "-%s-%s-%s-%s-%s-%s-%s-*-*-*-*-*-%s-%s",
798 preview(FontPanel
*panel
)
803 getSelectedFont(panel
, buffer
);
805 font
= WMCreateFont(WMWidgetScreen(panel
->win
), buffer
);
807 WMSetTextFieldFont(panel
->sampleT
, font
);
815 familyClick(WMWidget
*w
, void *data
)
817 WMList
*lPtr
= (WMList
*)w
;
820 FontPanel
*panel
= (FontPanel
*)data
;
823 /* current typeface and size */
829 /* must try to keep the same typeface and size for the new family */
830 item
= WMGetListSelectedItem(panel
->typLs
);
832 oface
= wstrdup(item
->text
);
834 osize
= WMGetTextFieldText(panel
->sizT
);
837 item
= WMGetListSelectedItem(lPtr
);
838 family
= (Family
*)item
->clientData
;
840 WMClearList(panel
->typLs
);
842 for (i
= 0; i
< WMGetBagItemCount(family
->typefaces
); i
++) {
847 face
= WMGetFromBag(family
->typefaces
, i
);
849 if (strcmp(face
->weight
, "medium") == 0) {
853 strcpy(buffer
, face
->weight
);
854 buffer
[0] = toupper(buffer
[0]);
861 if (strcmp(face
->slant
, "r") == 0) {
862 strcat(buffer
, "Roman");
864 } else if (strcmp(face
->slant
, "i") == 0) {
865 strcat(buffer
, "Italic");
866 } else if (strcmp(face
->slant
, "o") == 0) {
867 strcat(buffer
, "Oblique");
868 } else if (strcmp(face
->slant
, "ri") == 0) {
869 strcat(buffer
, "Rev Italic");
870 } else if (strcmp(face
->slant
, "ro") == 0) {
871 strcat(buffer
, "Rev Oblique");
873 strcat(buffer
, face
->slant
);
876 if (buffer
[0] == 0) {
877 strcpy(buffer
, "Normal");
881 fitem
= WMInsertListItem(panel
->typLs
, 0, buffer
);
883 fitem
= WMAddListItem(panel
->typLs
, buffer
);
884 fitem
->clientData
= face
;
888 facei
= WMFindRowOfListItemWithTitle(panel
->typLs
, oface
);
894 WMSelectListItem(panel
->typLs
, facei
);
895 typefaceClick(panel
->typLs
, panel
);
898 sizei
= WMFindRowOfListItemWithTitle(panel
->sizLs
, osize
);
901 WMSelectListItem(panel
->sizLs
, sizei
);
902 sizeClick(panel
->sizLs
, panel
);
914 typefaceClick(WMWidget
*w
, void *data
)
916 FontPanel
*panel
= (FontPanel
*)data
;
925 osize
= WMGetTextFieldText(panel
->sizT
);
928 item
= WMGetListSelectedItem(panel
->typLs
);
929 face
= (Typeface
*)item
->clientData
;
931 WMClearList(panel
->sizLs
);
933 for (i
= 0; i
< WMGetBagItemCount(face
->sizes
); i
++) {
936 size
= (int)WMGetFromBag(face
->sizes
, i
);
939 sprintf(buffer
, "%i", size
);
941 WMAddListItem(panel
->sizLs
, buffer
);
946 sizei
= WMFindRowOfListItemWithTitle(panel
->sizLs
, osize
);
949 sizei
= WMFindRowOfListItemWithTitle(panel
->sizLs
, "12");
954 WMSelectListItem(panel
->sizLs
, sizei
);
955 WMSetListPosition(panel
->sizLs
, sizei
);
956 sizeClick(panel
->sizLs
, panel
);
966 sizeClick(WMWidget
*w
, void *data
)
968 FontPanel
*panel
= (FontPanel
*)data
;
971 item
= WMGetListSelectedItem(panel
->sizLs
);
973 WMSetTextFieldText(panel
->sizT
, item
->text
);
975 WMSelectTextFieldRange(panel
->sizT
, wmkrange(0, strlen(item
->text
));