1 /*****************************************************************************
2 * prefs.m: MacOS X plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2002 VideoLAN
5 * $Id: prefs.m,v 1.1 2002/11/05 03:57:16 jlj Exp $
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
27 #include <stdlib.h> /* malloc(), free() */
28 #include <sys/param.h> /* for MAXPATHLEN */
31 #import <Cocoa/Cocoa.h>
39 /*****************************************************************************
40 * VLCPrefs implementation
41 *****************************************************************************/
42 @implementation VLCPrefs
50 p_intf = [NSApp getIntf];
52 o_pref_panels = [[NSMutableDictionary alloc] init];
53 o_toolbars = [[NSMutableDictionary alloc] init];
54 o_scroll_views = [[NSMutableDictionary alloc] init];
55 o_panel_views = [[NSMutableDictionary alloc] init];
56 o_save_prefs = [[NSMutableDictionary alloc] init];
68 #define DIC_REL1(o_dic) \
70 o_e1 = [o_dic objectEnumerator]; \
71 while( (v1 = [o_e1 nextObject]) ) \
75 [o_dic removeAllObjects]; \
79 #define DIC_REL2(o_dic) \
81 o_e2 = [o_dic objectEnumerator]; \
82 while( (v2 = [o_e2 nextObject]) ) \
86 [o_dic removeAllObjects]; \
89 DIC_REL1(o_pref_panels);
91 DIC_REL1(o_scroll_views);
92 DIC_REL2(o_panel_views);
93 DIC_REL1(o_save_prefs);
101 - (BOOL)hasPrefs:(NSString *)o_module_name
103 module_t **pp_parser;
105 char *psz_module_name;
107 psz_module_name = (char *)[o_module_name lossyCString];
109 /* look for module */
110 p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
112 for( pp_parser = (module_t **)p_list->pp_objects ;
116 if( !strcmp( (*pp_parser)->psz_object_name, psz_module_name ) )
118 BOOL b_has_prefs = (*pp_parser)->i_config_items != 0;
119 vlc_list_release( p_list );
120 return( b_has_prefs );
124 vlc_list_release( p_list );
129 - (void)createPrefPanel:(NSString *)o_module_name
134 module_t **pp_parser;
136 module_config_t *p_item;
137 char *psz_module_name;
139 NSPanel *o_panel; /* panel */
140 NSRect s_panel_rc; /* panel rect */
141 NSView *o_panel_view; /* panel view */
142 NSToolbar *o_toolbar; /* panel toolbar */
143 NSMutableDictionary *o_tb_items; /* panel toolbar items */
144 NSScrollView *o_scroll_view; /* panel scroll view */
145 NSRect s_scroll_rc; /* panel scroll view rect */
146 NSMutableDictionary *o_views; /* panel scroll view docviews */
148 NSRect s_rc; /* rect */
149 NSView *o_view; /* view */
150 NSRect s_vrc; /* view rect */
151 NSButton *o_button; /* button */
152 NSRect s_brc; /* button rect */
153 VLCTextField *o_text_field; /* input field / label */
155 o_panel = [o_pref_panels objectForKey: o_module_name];
159 [o_panel makeKeyAndOrderFront: nil];
163 psz_module_name = (char *)[o_module_name lossyCString];
165 /* Look for the selected module */
166 p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
168 for( pp_parser = (module_t **)p_list->pp_objects ;
173 && !strcmp( psz_module_name, (*pp_parser)->psz_object_name ) )
181 vlc_list_release( p_list );
185 /* We found it, now we can start building its configuration interface */
187 s_panel_rc = NSMakeRect( 0, 0, 450, 450 );
188 o_panel = [[NSPanel alloc] initWithContentRect: s_panel_rc
189 styleMask: NSTitledWindowMask
190 backing: NSBackingStoreBuffered
192 o_toolbar = [[NSToolbar alloc] initWithIdentifier: o_module_name];
193 [o_panel setTitle: [NSString stringWithFormat: @"%@ (%@)",
194 _NS("Preferences"), o_module_name]];
195 o_panel_view = [o_panel contentView];
197 s_scroll_rc = s_panel_rc;
198 s_scroll_rc.size.height -= 55; s_scroll_rc.origin.y += 55;
199 o_scroll_view = [[NSScrollView alloc] initWithFrame: s_scroll_rc];
200 [o_scroll_views setObject: o_scroll_view forKey: o_module_name];
201 [o_scroll_view setBorderType: NSGrooveBorder];
202 [o_scroll_view setHasVerticalScroller: YES];
203 [o_scroll_view setDrawsBackground: NO];
204 [o_scroll_view setRulersVisible: YES];
205 [o_panel_view addSubview: o_scroll_view];
207 o_tb_items = [[NSMutableDictionary alloc] init];
208 o_views = [[NSMutableDictionary alloc] init];
210 [o_save_prefs setObject: [[NSMutableArray alloc] init]
211 forKey: o_module_name];
213 /* Enumerate config options and add corresponding config boxes */
214 p_item = (*pp_parser)->p_config;
221 #define Y_ORIGIN (X_ORIGIN - 10)
223 #define CHECK_VIEW_HEIGHT \
225 float f_new_pos = s_rc.origin.y + s_rc.size.height + X_ORIGIN; \
226 if( f_new_pos > s_vrc.size.height ) \
228 s_vrc.size.height = f_new_pos; \
229 [o_view setFrame: s_vrc]; \
233 #define CONTROL_LABEL( label ) \
235 s_rc.origin.x += s_rc.size.width + 10; \
236 s_rc.size.width = s_vrc.size.width - s_rc.origin.x - X_ORIGIN - 20; \
237 o_text_field = [[NSTextField alloc] initWithFrame: s_rc]; \
238 [o_text_field setDrawsBackground: NO]; \
239 [o_text_field setBordered: NO]; \
240 [o_text_field setEditable: NO]; \
241 [o_text_field setSelectable: NO]; \
242 [o_text_field setStringValue: \
243 [NSString stringWithCString: label]]; \
244 [o_view addSubview: [o_text_field autorelease]]; \
247 #define INPUT_FIELD( ctype, cname, label, w, msg, param ) \
249 s_rc.size.height = 23; \
250 s_rc.size.width = w; \
251 s_rc.origin.y += 10; \
253 o_text_field = [[VLCTextField alloc] initWithFrame: s_rc]; \
254 [o_text_field setAlignment: NSRightTextAlignment]; \
255 CONTROL_CONFIG( o_text_field, o_module_name, ctype, cname ); \
256 [o_text_field msg: param]; \
257 [o_view addSubview: [o_text_field autorelease]]; \
258 [[NSNotificationCenter defaultCenter] addObserver: self \
259 selector: @selector(configChanged:) \
260 name: NSControlTextDidChangeNotification \
261 object: o_text_field]; \
262 CONTROL_LABEL( label ); \
263 s_rc.origin.y += s_rc.size.height; \
264 s_rc.origin.x = X_ORIGIN; \
267 #define INPUT_FIELD_INTEGER( name, label, w, param ) \
268 INPUT_FIELD( CONFIG_ITEM_INTEGER, name, label, w, setIntValue, param )
269 #define INPUT_FIELD_FLOAT( name, label, w, param ) \
270 INPUT_FIELD( CONFIG_ITEM_FLOAT, name, label, w, setFloatValue, param )
271 #define INPUT_FIELD_STRING( name, label, w, param ) \
272 INPUT_FIELD( CONFIG_ITEM_STRING, name, label, w, setStringValue, param )
277 switch( p_item->i_type )
280 case CONFIG_HINT_CATEGORY:
284 NSToolbarItem *o_tbi;
286 o_label = [NSString stringWithCString: p_item->psz_text];
287 o_tbi = [[NSToolbarItem alloc] initWithItemIdentifier: o_label];
288 [o_tbi setImage: [NSImage imageNamed: @"NSApplicationIcon"]];
289 [o_tbi setLabel: o_label];
290 [o_tbi setTarget: self];
291 [o_tbi setAction: @selector(selectPrefView:)];
293 o_key = [NSString stringWithFormat: @"%02d %@",
295 [o_tb_items setObject: o_tbi forKey: o_key];
297 s_vrc = s_scroll_rc; s_vrc.size.height -= 4;
298 o_view = [[VLCFlippedView alloc] initWithFrame: s_vrc];
299 [o_views setObject: o_view forKey: o_label];
301 s_rc.origin.x = X_ORIGIN;
302 s_rc.origin.y = Y_ORIGIN;
308 [o_scroll_view setDocumentView: o_view];
315 case CONFIG_ITEM_MODULE:
320 NSPopUpButton *o_modules;
321 NSButton *o_btn_select;
322 NSButton *o_btn_configure;
324 #define MODULE_BUTTON( button, title, sel ) \
326 s_brc.size.height = 25; \
327 s_brc.origin.x += s_brc.size.width + 10; \
328 s_brc.size.width = s_crc.size.width - s_brc.origin.x - 10; \
329 button = [[NSButton alloc] initWithFrame: s_brc]; \
330 [button setButtonType: NSMomentaryPushInButton]; \
331 [button setBezelStyle: NSRoundedBezelStyle]; \
332 [button setTitle: title]; \
333 [button setTag: i_module_tag++]; \
334 [button setTarget: self]; \
335 [button setAction: @selector(sel)]; \
336 [o_cview addSubview: [button autorelease]]; \
339 s_rc.size.height = 100;
340 s_rc.size.width = s_vrc.size.width - X_ORIGIN * 2 - 20;
341 s_rc.origin.y += i_module_tag == 3 ? Y_ORIGIN : 20;
345 o_box = [[NSBox alloc] initWithFrame: s_rc];
346 [o_box setTitle: [NSString stringWithCString: p_item->psz_text]];
347 [o_view addSubview: [o_box autorelease]];
348 s_rc.origin.y += s_rc.size.height + 10;
349 o_cview = [[VLCFlippedView alloc] initWithFrame: s_rc];
350 [o_box setContentView: [o_cview autorelease]];
351 s_crc = [o_cview bounds];
353 s_brc = NSMakeRect( 5, 10, 200, 23 );
354 o_modules = [[NSPopUpButton alloc] initWithFrame: s_brc];
355 [o_modules setTag: i_module_tag++];
356 [o_modules setTarget: self];
357 [o_modules setAction: @selector(moduleSelected:)];
358 [o_cview addSubview: [o_modules autorelease]];
360 MODULE_BUTTON( o_btn_configure, _NS("Configure"),
363 s_brc = NSMakeRect( 8, s_brc.origin.y + s_brc.size.height + 10,
365 o_text_field = [[VLCTextField alloc] initWithFrame: s_brc];
366 [o_text_field setTag: i_module_tag++];
367 [o_text_field setAlignment: NSLeftTextAlignment];
368 CONTROL_CONFIG( o_text_field, o_module_name,
369 CONFIG_ITEM_MODULE, p_item->psz_name );
370 [[NSNotificationCenter defaultCenter] addObserver: self
371 selector: @selector(configChanged:)
372 name: NSControlTextDidChangeNotification
373 object: o_text_field];
374 [o_cview addSubview: [o_text_field autorelease]];
377 MODULE_BUTTON( o_btn_select, _NS("Select"),
380 [o_modules addItemWithTitle: _NS("None")];
382 /* build a list of available modules */
384 pp_parser = (module_t **)p_list->pp_objects;
386 for( ; *pp_parser ; pp_parser++ )
388 if( !strcmp( (*pp_parser)->psz_capability,
391 NSString *o_object_name = [NSString
392 stringWithCString: (*pp_parser)->psz_object_name];
393 [o_modules addItemWithTitle: o_object_name];
398 if( p_item->psz_value != NULL )
401 [NSString stringWithCString: p_item->psz_value];
403 [o_text_field setStringValue: o_value];
404 [o_modules selectItemWithTitle: o_value];
405 [o_btn_configure setEnabled: [self hasPrefs: o_value]];
409 [o_modules selectItemWithTitle: _NS("None")];
410 [o_btn_configure setEnabled: NO];
417 case CONFIG_ITEM_STRING:
418 case CONFIG_ITEM_FILE:
421 if( !p_item->ppsz_list )
423 char *psz_value = p_item->psz_value ?
424 p_item->psz_value : "";
426 INPUT_FIELD_STRING( p_item->psz_name, p_item->psz_text, 150,
427 [NSString stringWithCString: psz_value] );
432 VLCComboBox *o_combo_box;
434 s_rc.size.height = 25;
435 s_rc.size.width = 150;
440 o_combo_box = [[VLCComboBox alloc] initWithFrame: s_rc];
441 CONTROL_CONFIG( o_combo_box, o_module_name,
442 CONFIG_ITEM_STRING, p_item->psz_name );
443 [o_view addSubview: [o_combo_box autorelease]];
444 [[NSNotificationCenter defaultCenter] addObserver: self
445 selector: @selector(configChanged:)
446 name: NSControlTextDidChangeNotification
447 object: o_combo_box];
448 [[NSNotificationCenter defaultCenter] addObserver: self
449 selector: @selector(configChanged:)
450 name: NSComboBoxSelectionDidChangeNotification
451 object: o_combo_box];
453 for( i=0; p_item->ppsz_list[i]; i++ )
455 [o_combo_box addItemWithObjectValue:
456 [NSString stringWithCString: p_item->ppsz_list[i]]];
459 CONTROL_LABEL( p_item->psz_text );
461 s_rc.origin.y += s_rc.size.height;
462 s_rc.origin.x = X_ORIGIN;
468 case CONFIG_ITEM_INTEGER:
470 INPUT_FIELD_INTEGER( p_item->psz_name, p_item->psz_text, 70,
475 case CONFIG_ITEM_FLOAT:
477 INPUT_FIELD_FLOAT( p_item->psz_name, p_item->psz_text, 70,
482 case CONFIG_ITEM_BOOL:
484 VLCButton *o_btn_bool;
486 s_rc.size.height = 20;
487 s_rc.size.width = s_vrc.size.width - X_ORIGIN * 2 - 20;
492 o_btn_bool = [[VLCButton alloc] initWithFrame: s_rc];
493 [o_btn_bool setButtonType: NSSwitchButton];
494 [o_btn_bool setIntValue: p_item->i_value];
495 [o_btn_bool setTitle:
496 [NSString stringWithCString: p_item->psz_text]];
497 [o_btn_bool setTarget: self];
498 [o_btn_bool setAction: @selector(configChanged:)];
499 CONTROL_CONFIG( o_btn_bool, o_module_name,
500 CONFIG_ITEM_BOOL, p_item->psz_name );
501 [o_view addSubview: [o_btn_bool autorelease]];
503 s_rc.origin.y += s_rc.size.height;
509 #undef INPUT_FIELD_INTEGER
510 #undef INPUT_FIELD_FLOAT
511 #undef INPUT_FIELD_STRING
513 #undef CHECK_VIEW_HEIGHT
518 while( p_item->i_type != CONFIG_HINT_END && p_item++ );
520 vlc_list_release( p_list );
522 [o_toolbars setObject: o_tb_items forKey: o_module_name];
523 [o_toolbar setDelegate: self];
524 [o_panel setToolbar: [o_toolbar autorelease]];
526 #define DEF_PANEL_BUTTON( tag, title, sel ) \
528 o_button = [[NSButton alloc] initWithFrame: s_rc]; \
529 [o_button setButtonType: NSMomentaryPushInButton]; \
530 [o_button setBezelStyle: NSRoundedBezelStyle]; \
531 [o_button setAction: @selector(sel)]; \
532 [o_button setTarget: self]; \
533 [o_button setTitle: title]; \
534 [o_button setTag: tag]; \
535 [o_panel_view addSubview: [o_button autorelease]]; \
538 s_rc.origin.y = s_panel_rc.origin.y + 14;
539 s_rc.size.height = 25; s_rc.size.width = 100;
540 s_rc.origin.x = s_panel_rc.size.width - s_rc.size.width - 14;
541 DEF_PANEL_BUTTON( 0, _NS("OK"), clickedCancelOK: );
542 [o_panel setDefaultButtonCell: [o_button cell]];
544 s_rc.origin.x -= s_rc.size.width;
545 DEF_PANEL_BUTTON( 1, _NS("Cancel"), clickedCancelOK: );
547 s_rc.origin.x -= s_rc.size.width;
548 DEF_PANEL_BUTTON( 2, _NS("Apply"), clickedApply: );
549 [o_button setEnabled: NO];
551 #undef DEF_PANEL_BUTTON
553 [o_pref_panels setObject: o_panel forKey: o_module_name];
554 [o_panel_views setObject: o_views forKey: o_module_name];
557 [o_panel makeKeyAndOrderFront: nil];
560 - (void)destroyPrefPanel:(id)o_unknown
565 NSMutableArray *o_prefs;
566 NSMutableDictionary *o_dic;
567 NSScrollView *o_scroll_view;
568 NSString *o_module_name;
570 o_module_name = (NSString *)([o_unknown isKindOfClass: [NSTimer class]] ?
571 [o_unknown userInfo] : o_unknown);
573 #define DIC_REL(dic) \
575 o_dic = [dic objectForKey: o_module_name]; \
576 [dic removeObjectForKey: o_module_name]; \
577 o_e1 = [o_dic objectEnumerator]; \
578 while( (v1 = [o_e1 nextObject]) ) \
582 [o_dic removeAllObjects]; \
586 o_panel = [o_pref_panels objectForKey: o_module_name];
587 [o_pref_panels removeObjectForKey: o_module_name];
592 o_scroll_view = [o_scroll_views objectForKey: o_module_name];
593 [o_scroll_views removeObjectForKey: o_module_name];
594 [o_scroll_view release];
596 DIC_REL(o_panel_views);
598 o_prefs = [o_save_prefs objectForKey: o_module_name];
599 [o_save_prefs removeObjectForKey: o_module_name];
600 [o_prefs removeAllObjects];
607 - (void)selectPrefView:(id)sender
610 NSString *o_module_name;
611 NSScrollView *o_scroll_view;
612 NSMutableDictionary *o_views;
614 o_module_name = [[sender toolbar] identifier];
615 o_views = [o_panel_views objectForKey: o_module_name];
616 o_view = [o_views objectForKey: [sender label]];
618 o_scroll_view = [o_scroll_views objectForKey: o_module_name];
619 [o_scroll_view setDocumentView: o_view];
622 - (void)moduleSelected:(id)sender
624 NSButton *o_btn_config;
625 NSString *o_module_name;
626 BOOL b_has_prefs = NO;
628 o_module_name = [sender titleOfSelectedItem];
629 o_btn_config = [[sender superview] viewWithTag: [sender tag] + 1];
631 if( ![o_module_name isEqualToString: _NS("None")] )
633 b_has_prefs = [self hasPrefs: o_module_name];
636 [o_btn_config setEnabled: b_has_prefs];
639 - (void)configureModule:(id)sender
641 NSString *o_module_name;
642 NSPopUpButton *o_modules;
644 o_modules = [[sender superview] viewWithTag: [sender tag] - 1];
645 o_module_name = [o_modules titleOfSelectedItem];
647 [self createPrefPanel: o_module_name];
650 - (void)selectModule:(id)sender
652 NSString *o_module_name;
653 NSPopUpButton *o_modules;
654 NSTextField *o_module;
656 o_module = [[sender superview] viewWithTag: [sender tag] - 1];
657 o_modules = [[sender superview] viewWithTag: [sender tag] - 3];
658 o_module_name = [o_modules titleOfSelectedItem];
660 if( [o_module_name isEqualToString: _NS("None")] )
662 o_module_name = [NSString string];
665 [o_module setStringValue: o_module_name];
666 [self configChanged: o_module];
669 - (void)configChanged:(id)o_unknown
671 id o_vlc_config = [o_unknown isKindOfClass: [NSNotification class]] ?
672 [o_unknown object] : o_unknown;
674 NSString *o_module_name = [o_vlc_config moduleName];
675 NSPanel *o_pref_panel = [o_pref_panels objectForKey: o_module_name];
676 NSMutableArray *o_prefs = [o_save_prefs objectForKey: o_module_name];
678 if( [o_prefs indexOfObjectIdenticalTo: o_vlc_config] == NSNotFound )
680 NSView *o_pref_view = [o_pref_panel contentView];
681 NSButton *o_btn_apply = [o_pref_view viewWithTag: 2];
683 [o_prefs addObject: o_vlc_config];
684 [o_btn_apply setEnabled: YES];
688 - (void)clickedApply:(id)sender
691 NSEnumerator *o_enum;
693 NSView *o_config_view = [sender superview];
694 NSWindow *o_config_panel = [o_config_view window];
695 NSButton *o_btn_apply = [o_config_view viewWithTag: 2];
696 NSString *o_module_name = [[o_config_panel toolbar] identifier];
697 NSMutableArray *o_prefs = [o_save_prefs objectForKey: o_module_name];
699 o_enum = [o_prefs objectEnumerator];
700 while( ( o_vlc_control = [o_enum nextObject] ) )
702 int i_type = [o_vlc_control configType];
703 NSString *o_name = [o_vlc_control configName];
704 char *psz_name = (char *)[o_name lossyCString];
709 case CONFIG_ITEM_MODULE:
710 case CONFIG_ITEM_STRING:
711 case CONFIG_ITEM_FILE:
716 o_value = [o_vlc_control stringValue];
717 psz_value = (char *)[o_value lossyCString];
719 config_PutPsz( p_intf, psz_name,
720 *psz_value ? psz_value : NULL );
724 case CONFIG_ITEM_INTEGER:
725 case CONFIG_ITEM_BOOL:
727 int i_value = [o_vlc_control intValue];
729 config_PutInt( p_intf, psz_name, i_value );
733 case CONFIG_ITEM_FLOAT:
735 float f_value = [o_vlc_control floatValue];
737 config_PutFloat( p_intf, psz_name, f_value );
744 [o_btn_apply setEnabled: NO];
745 [o_prefs removeAllObjects];
747 config_SaveConfigFile( p_intf, NULL );
750 - (void)clickedCancelOK:(id)sender
752 NSWindow *o_pref_panel = [[sender superview] window];
753 NSString *o_module_name = [[o_pref_panel toolbar] identifier];
755 if( [[sender title] isEqualToString: _NS("OK")] )
757 [self clickedApply: sender];
760 [o_pref_panel close];
762 if( [self respondsToSelector: @selector(performSelectorOnMainThread:
763 withObject:waitUntilDone:)] )
765 [self performSelectorOnMainThread: @selector(destroyPrefPanel:)
766 withObject: o_module_name
771 [NSTimer scheduledTimerWithTimeInterval: 0.1
772 target: self selector: @selector(destroyPrefPanel:)
773 userInfo: o_module_name repeats: NO];
779 @implementation VLCPrefs (NSToolbarDelegate)
781 - (NSToolbarItem *)toolbar:(NSToolbar *)o_toolbar
782 itemForItemIdentifier:(NSString *)o_item_id
783 willBeInsertedIntoToolbar:(BOOL)b_flag
785 NSMutableDictionary *o_toolbar_items;
786 NSString *o_module_name = [o_toolbar identifier];
788 o_toolbar_items = [o_toolbars objectForKey: o_module_name];
789 if( o_toolbar_items == nil )
794 return( [o_toolbar_items objectForKey: o_item_id] );
797 - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)o_toolbar
799 return( [self toolbarDefaultItemIdentifiers: o_toolbar] );
802 - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)o_toolbar
805 NSMutableDictionary *o_toolbar_items;
806 NSString *o_module_name = [o_toolbar identifier];
808 o_toolbar_items = [o_toolbars objectForKey: o_module_name];
809 if( o_toolbar_items == nil )
814 o_ids = [[o_toolbar_items allKeys]
815 sortedArrayUsingSelector: @selector(compare:)];
822 @implementation VLCFlippedView
831 IMPL_CONTROL_CONFIG(Button);
832 IMPL_CONTROL_CONFIG(ComboBox);
833 IMPL_CONTROL_CONFIG(TextField);