2 /* MouseSettings.c- mouse options (some are equivalent to xset)
4 * WPrefs - Window Maker Preferences Program
6 * Copyright (c) 1998-2003 Alfredo K. Kojima
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include <X11/Xutil.h>
26 #include <X11/XKBlib.h>
34 typedef struct _Panel
{
41 CallbackRec callbacks
;
64 WMPopUpButton
*button1P
;
65 WMPopUpButton
*button2P
;
66 WMPopUpButton
*button3P
;
67 WMPopUpButton
*wheelP
;
74 /**/ int maxThreshold
;
78 #define ICON_FILE "mousesettings"
80 #define SPEED_ICON_FILE "mousespeed"
82 #define DELAY_ICON "timer%i"
83 #define DELAY_ICON_S "timer%is"
85 /* need access to the double click variables */
86 #include <WINGs/WINGsP.h>
88 static char *modifierNames
[8];
90 static char *buttonActions
[4];
92 static char *wheelActions
[2];
94 #define DELAY(i) ((i)*75+170)
97 static void setMouseAccel(WMScreen
* scr
, float accel
, int threshold
)
104 XChangePointerControl(WMScreenDisplay(scr
), True
, True
, n
, d
, threshold
);
107 static void speedChange(WMWidget
* w
, void *data
)
109 _Panel
*panel
= (_Panel
*) data
;
118 tmp
= WMGetTextFieldText(panel
->acceT
);
119 if (sscanf(tmp
, "%f", &accel
) != 1 || accel
< 0) {
120 WMRunAlertPanel(WMWidgetScreen(panel
->acceT
), GetWindow(panel
),
122 _("Invalid mouse acceleration value. Must be a positive real value."),
123 _("OK"), NULL
, NULL
);
127 panel
->acceleration
= accel
;
130 i
= (int)WMGetSliderValue(panel
->speedS
);
132 panel
->acceleration
= 0.25 + (i
* 0.25);
134 sprintf(buffer
, "%.2f", 0.25 + (i
* 0.25));
135 WMSetTextFieldText(panel
->acceT
, buffer
);
138 tmp
= WMGetTextFieldText(panel
->threT
);
139 if (sscanf(tmp
, "%i", &threshold
) != 1 || threshold
< 0 || threshold
> panel
->maxThreshold
) {
140 WMRunAlertPanel(WMWidgetScreen(panel
->parent
), GetWindow(panel
), _("Error"),
142 ("Invalid mouse acceleration threshold value. Must be the number of pixels to travel before accelerating."),
143 _("OK"), NULL
, NULL
);
145 setMouseAccel(WMWidgetScreen(panel
->parent
), panel
->acceleration
, threshold
);
150 static void returnPressed(void *observerData
, WMNotification
* notification
)
152 _Panel
*panel
= (_Panel
*) observerData
;
154 speedChange(NULL
, panel
);
157 static void doubleClick(WMWidget
* w
, void *data
)
159 _Panel
*panel
= (_Panel
*) data
;
161 extern _WINGsConfiguration WINGsConfiguration
;
164 for (i
= 0; i
< 5; i
++) {
165 if (panel
->ddelaB
[i
] == w
)
168 WINGsConfiguration
.doubleClickDelay
= DELAY(i
);
170 sprintf(buffer
, "%i", DELAY(i
));
171 WMSetTextFieldText(panel
->ddelaT
, buffer
);
174 static int getButtonAction(const char *str
)
179 if (strcasecmp(str
, "None") == 0)
181 else if (strcasecmp(str
, "OpenApplicationsMenu") == 0)
183 else if (strcasecmp(str
, "OpenWindowListMenu") == 0)
185 else if (strcasecmp(str
, "SelectWindows") == 0)
192 static int getWheelAction(const char *str
)
197 if (strcasecmp(str
, "None") == 0)
199 else if (strcasecmp(str
, "SwitchWorkspaces") == 0)
206 static void getMouseParameters(Display
* dpy
, float *accel
, int *thre
)
210 XGetPointerControl(dpy
, &n
, &d
, thre
);
212 *accel
= (float)n
/ (float)d
;
215 static void showData(_Panel
* panel
)
219 int a
= -1, b
= -1, c
= -1, w
= -1;
222 Display
*dpy
= WMScreenDisplay(WMWidgetScreen(panel
->parent
));
224 str
= GetStringForKey("MouseLeftButtonAction");
225 i
= getButtonAction(str
);
229 wwarning(_("bad value %s for option %s"), str
, "MouseLeftButtonAction");
234 WMSetPopUpButtonSelectedItem(panel
->button1P
, a
);
236 str
= GetStringForKey("MouseMiddleButtonAction");
237 i
= getButtonAction(str
);
241 wwarning(_("bad value %s for option %s"), str
, "MouseMiddleButtonAction");
246 WMSetPopUpButtonSelectedItem(panel
->button2P
, b
);
248 str
= GetStringForKey("MouseRightButtonAction");
249 i
= getButtonAction(str
);
253 wwarning(_("bad value %s for option %s"), str
, "MouseRightButtonAction");
258 WMSetPopUpButtonSelectedItem(panel
->button3P
, c
);
260 str
= GetStringForKey("MouseWheelAction");
261 i
= getWheelAction(str
);
265 wwarning(_("bad value %s for option %s"), str
, "MouseWheelAction");
270 WMSetPopUpButtonSelectedItem(panel
->wheelP
, w
);
272 WMSetButtonSelected(panel
->disaB
, GetBoolForKey("DisableWSMouseActions"));
274 /**/ getMouseParameters(dpy
, &accel
, &a
);
275 panel
->maxThreshold
= WidthOfScreen(DefaultScreenOfDisplay(dpy
));
276 if (a
> panel
->maxThreshold
) {
277 panel
->maxThreshold
= a
;
279 sprintf(buffer
, "%i", a
);
280 WMSetTextFieldText(panel
->threT
, buffer
);
282 WMSetSliderValue(panel
->speedS
, (accel
- 0.25) / 0.25);
284 panel
->acceleration
= accel
;
285 sprintf(buffer
, "%.2f", accel
);
286 WMSetTextFieldText(panel
->acceT
, buffer
);
288 /**/ b
= GetIntegerForKey("DoubleClickTime");
289 /* find best match */
291 for (i
= 0; i
< 5; i
++) {
296 WMPerformButtonClick(panel
->ddelaB
[a
]);
297 sprintf(buffer
, "%i", b
);
298 WMSetTextFieldText(panel
->ddelaT
, buffer
);
300 /**/ str
= GetStringForKey("ModifierKey");
303 a
= ModifierFromKey(dpy
, str
);
306 str
= modifierNames
[a
];
309 for (i
= 0; i
< WMGetPopUpButtonNumberOfItems(panel
->grabP
); i
++) {
310 if (strstr(WMGetPopUpButtonItem(panel
->grabP
, i
), str
)) {
311 WMSetPopUpButtonSelectedItem(panel
->grabP
, i
);
319 sscanf(WMGetPopUpButtonItem(panel
->grabP
, 0), "%s", buffer
);
320 WMSetPopUpButtonSelectedItem(panel
->grabP
, 0);
321 wwarning(_("modifier key %s for option ModifierKey was not recognized. Using %s as default"),
326 static void fillModifierPopUp(WMPopUpButton
* pop
)
328 XModifierKeymap
*mapping
;
329 Display
*dpy
= WMScreenDisplay(WMWidgetScreen(pop
));
334 mapping
= XGetModifierMapping(dpy
);
336 if (!mapping
|| mapping
->max_keypermod
== 0) {
337 WMAddPopUpButtonItem(pop
, "Mod1");
338 WMAddPopUpButtonItem(pop
, "Mod2");
339 WMAddPopUpButtonItem(pop
, "Mod3");
340 WMAddPopUpButtonItem(pop
, "Mod4");
341 WMAddPopUpButtonItem(pop
, "Mod5");
342 wwarning(_("could not retrieve keyboard modifier mapping"));
346 for (j
= 0; j
< 8; j
++) {
356 memset(array
, 0, sizeof(char *) * 8);
357 for (i
= 0; i
< mapping
->max_keypermod
; i
++) {
358 idx
= i
+ j
* mapping
->max_keypermod
;
359 if (mapping
->modifiermap
[idx
] != 0) {
361 for (l
= 0; l
< 4; l
++) {
362 ksym
= XkbKeycodeToKeysym(dpy
, mapping
->modifiermap
[idx
], 0, l
);
363 if (ksym
!= NoSymbol
)
366 if (ksym
!= NoSymbol
)
367 str
= XKeysymToString(ksym
);
370 if (str
&& !strstr(str
, "_Lock") && !strstr(str
, "Shift")
371 && !strstr(str
, "Control")) {
372 array
[a
++] = wstrdup(str
);
377 for (k
= 0; k
< a
; k
++) {
378 if (array
[k
] == NULL
)
380 tmp
= wstrdup(array
[k
]);
381 ptr
= strstr(tmp
, "_L");
384 ptr
= strstr(tmp
, "_R");
387 sprintf(buffer
, "%s (%s)", modifierNames
[j
], tmp
);
388 /*sprintf(buffer, "%s", tmp); */
389 WMAddPopUpButtonItem(pop
, buffer
);
390 for (i
= k
+ 1; i
< a
; i
++) {
391 if (array
[i
] == NULL
)
393 if (strstr(array
[i
], tmp
)) {
409 XFreeModifiermap(mapping
);
412 static void createPanel(Panel
* p
)
414 _Panel
*panel
= (_Panel
*) p
;
415 WMScreen
*scr
= WMWidgetScreen(panel
->parent
);
426 panel
->box
= WMCreateBox(panel
->parent
);
427 WMSetViewExpandsToParent(WMWidgetView(panel
->box
), 2, 2, 2, 2);
429 /**************** Mouse Speed ****************/
430 panel
->speedF
= WMCreateFrame(panel
->box
);
431 WMResizeWidget(panel
->speedF
, 245, 100);
432 WMMoveWidget(panel
->speedF
, 15, 5);
433 WMSetFrameTitle(panel
->speedF
, _("Mouse Speed"));
435 panel
->speedL
= WMCreateLabel(panel
->speedF
);
436 WMResizeWidget(panel
->speedL
, 40, 46);
437 WMMoveWidget(panel
->speedL
, 15, 14);
438 WMSetLabelImagePosition(panel
->speedL
, WIPImageOnly
);
439 path
= LocateImage(SPEED_ICON_FILE
);
441 icon
= WMCreateBlendedPixmapFromFile(scr
, path
, &color
);
443 WMSetLabelImage(panel
->speedL
, icon
);
444 WMReleasePixmap(icon
);
446 wwarning(_("could not load icon %s"), path
);
451 panel
->speedS
= WMCreateSlider(panel
->speedF
);
452 WMResizeWidget(panel
->speedS
, 160, 15);
453 WMMoveWidget(panel
->speedS
, 70, 35);
454 WMSetSliderMinValue(panel
->speedS
, 0);
455 WMSetSliderMaxValue(panel
->speedS
, 40);
456 WMSetSliderContinuous(panel
->speedS
, False
);
457 WMSetSliderAction(panel
->speedS
, speedChange
, panel
);
459 panel
->acceL
= WMCreateLabel(panel
->speedF
);
460 WMResizeWidget(panel
->acceL
, 70, 16);
461 WMMoveWidget(panel
->acceL
, 10, 67);
462 WMSetLabelTextAlignment(panel
->acceL
, WARight
);
463 WMSetLabelText(panel
->acceL
, _("Acceler.:"));
465 panel
->acceT
= WMCreateTextField(panel
->speedF
);
466 WMResizeWidget(panel
->acceT
, 40, 20);
467 WMMoveWidget(panel
->acceT
, 80, 65);
468 WMAddNotificationObserver(returnPressed
, panel
, WMTextDidEndEditingNotification
, panel
->acceT
);
470 panel
->threL
= WMCreateLabel(panel
->speedF
);
471 WMResizeWidget(panel
->threL
, 80, 16);
472 WMMoveWidget(panel
->threL
, 120, 67);
473 WMSetLabelTextAlignment(panel
->threL
, WARight
);
474 WMSetLabelText(panel
->threL
, _("Threshold:"));
476 panel
->threT
= WMCreateTextField(panel
->speedF
);
477 WMResizeWidget(panel
->threT
, 30, 20);
478 WMMoveWidget(panel
->threT
, 200, 65);
479 WMAddNotificationObserver(returnPressed
, panel
, WMTextDidEndEditingNotification
, panel
->threT
);
481 WMMapSubwidgets(panel
->speedF
);
483 /***************** Doubleclick Delay ****************/
485 panel
->ddelaF
= WMCreateFrame(panel
->box
);
486 WMResizeWidget(panel
->ddelaF
, 245, 105);
487 WMMoveWidget(panel
->ddelaF
, 15, 115);
488 WMSetFrameTitle(panel
->ddelaF
, _("Double-Click Delay"));
490 buf1
= wmalloc(strlen(DELAY_ICON
) + 2);
491 buf2
= wmalloc(strlen(DELAY_ICON_S
) + 2);
493 for (i
= 0; i
< 5; i
++) {
494 panel
->ddelaB
[i
] = WMCreateCustomButton(panel
->ddelaF
, WBBStateChangeMask
);
495 WMResizeWidget(panel
->ddelaB
[i
], 25, 25);
496 WMMoveWidget(panel
->ddelaB
[i
], 30 + (40 * i
), 25);
497 WMSetButtonBordered(panel
->ddelaB
[i
], False
);
498 WMSetButtonImagePosition(panel
->ddelaB
[i
], WIPImageOnly
);
499 WMSetButtonAction(panel
->ddelaB
[i
], doubleClick
, panel
);
501 WMGroupButtons(panel
->ddelaB
[0], panel
->ddelaB
[i
]);
503 sprintf(buf1
, DELAY_ICON
, i
+ 1);
504 sprintf(buf2
, DELAY_ICON_S
, i
+ 1);
505 path
= LocateImage(buf1
);
507 icon
= WMCreatePixmapFromFile(scr
, path
);
509 WMSetButtonImage(panel
->ddelaB
[i
], icon
);
510 WMReleasePixmap(icon
);
512 wwarning(_("could not load icon file %s"), path
);
516 path
= LocateImage(buf2
);
518 icon
= WMCreatePixmapFromFile(scr
, path
);
520 WMSetButtonAltImage(panel
->ddelaB
[i
], icon
);
521 WMReleasePixmap(icon
);
523 wwarning(_("could not load icon file %s"), path
);
531 panel
->tester
= CreateDoubleTest(panel
->ddelaF
, _("Test"));
532 WMResizeWidget(panel
->tester
, 84, 29);
533 WMMoveWidget(panel
->tester
, 35, 60);
535 panel
->ddelaT
= WMCreateTextField(panel
->ddelaF
);
536 WMResizeWidget(panel
->ddelaT
, 40, 20);
537 WMMoveWidget(panel
->ddelaT
, 140, 65);
539 panel
->ddelaL
= WMCreateLabel(panel
->ddelaF
);
540 WMResizeWidget(panel
->ddelaL
, 40, 16);
541 WMMoveWidget(panel
->ddelaL
, 185, 70);
546 font
= WMSystemFontOfSize(scr
, 10);
547 color
= WMDarkGrayColor(scr
);
548 WMSetLabelTextColor(panel
->ddelaL
, color
);
549 WMSetLabelFont(panel
->ddelaL
, font
);
551 WMReleaseColor(color
);
553 WMSetLabelText(panel
->ddelaL
, _("msec"));
555 WMMapSubwidgets(panel
->ddelaF
);
557 /* ************** Workspace Action Buttons **************** */
558 panel
->menuF
= WMCreateFrame(panel
->box
);
559 WMResizeWidget(panel
->menuF
, 240, 160);
560 WMMoveWidget(panel
->menuF
, 270, 5);
561 WMSetFrameTitle(panel
->menuF
, _("Workspace Mouse Actions"));
563 panel
->disaB
= WMCreateSwitchButton(panel
->menuF
);
564 WMResizeWidget(panel
->disaB
, 205, 18);
565 WMMoveWidget(panel
->disaB
, 10, 18);
566 WMSetButtonText(panel
->disaB
, _("Disable mouse actions"));
568 panel
->button1L
= WMCreateLabel(panel
->menuF
);
569 WMResizeWidget(panel
->button1L
, 87, 20);
570 WMMoveWidget(panel
->button1L
, 5, 45);
571 WMSetLabelTextAlignment(panel
->button1L
, WARight
);
572 WMSetLabelText(panel
->button1L
, _("Left Button"));
574 panel
->button1P
= WMCreatePopUpButton(panel
->menuF
);
575 WMResizeWidget(panel
->button1P
, 135, 20);
576 WMMoveWidget(panel
->button1P
, 95, 45);
578 panel
->button2L
= WMCreateLabel(panel
->menuF
);
579 WMResizeWidget(panel
->button2L
, 87, 20);
580 WMMoveWidget(panel
->button2L
, 5, 73);
581 WMSetLabelTextAlignment(panel
->button2L
, WARight
);
582 WMSetLabelText(panel
->button2L
, _("Middle Button"));
584 panel
->button2P
= WMCreatePopUpButton(panel
->menuF
);
585 WMResizeWidget(panel
->button2P
, 135, 20);
586 WMMoveWidget(panel
->button2P
, 95, 73);
588 panel
->button3L
= WMCreateLabel(panel
->menuF
);
589 WMResizeWidget(panel
->button3L
, 87, 20);
590 WMMoveWidget(panel
->button3L
, 5, 101);
591 WMSetLabelTextAlignment(panel
->button3L
, WARight
);
592 WMSetLabelText(panel
->button3L
, _("Right Button"));
594 panel
->button3P
= WMCreatePopUpButton(panel
->menuF
);
595 WMResizeWidget(panel
->button3P
, 135, 20);
596 WMMoveWidget(panel
->button3P
, 95, 101);
598 panel
->wheelL
= WMCreateLabel(panel
->menuF
);
599 WMResizeWidget(panel
->wheelL
, 87, 20);
600 WMMoveWidget(panel
->wheelL
, 5, 129);
601 WMSetLabelTextAlignment(panel
->wheelL
, WARight
);
602 WMSetLabelText(panel
->wheelL
, _("Mouse Wheel"));
604 panel
->wheelP
= WMCreatePopUpButton(panel
->menuF
);
605 WMResizeWidget(panel
->wheelP
, 135, 20);
606 WMMoveWidget(panel
->wheelP
, 95, 129);
608 for (i
= 0; i
< sizeof(buttonActions
) / sizeof(buttonActions
[0]); i
++) {
609 WMAddPopUpButtonItem(panel
->button1P
, buttonActions
[i
]);
610 WMAddPopUpButtonItem(panel
->button2P
, buttonActions
[i
]);
611 WMAddPopUpButtonItem(panel
->button3P
, buttonActions
[i
]);
614 for (i
= 0; i
< sizeof(wheelActions
) / sizeof(wheelActions
[0]); i
++) {
615 WMAddPopUpButtonItem(panel
->wheelP
, wheelActions
[i
]);
618 WMMapSubwidgets(panel
->menuF
);
620 /* ************** Grab Modifier **************** */
621 panel
->grabF
= WMCreateFrame(panel
->box
);
622 WMResizeWidget(panel
->grabF
, 240, 50);
623 WMMoveWidget(panel
->grabF
, 270, 170);
624 WMSetFrameTitle(panel
->grabF
, _("Mouse Grab Modifier"));
626 WMSetBalloonTextForView(_("Keyboard modifier to use for actions that\n"
627 "involve dragging windows with the mouse,\n"
628 "clicking inside the window."), WMWidgetView(panel
->grabF
));
630 panel
->grabP
= WMCreatePopUpButton(panel
->grabF
);
631 WMResizeWidget(panel
->grabP
, 160, 20);
632 WMMoveWidget(panel
->grabP
, 40, 20);
634 fillModifierPopUp(panel
->grabP
);
636 WMMapSubwidgets(panel
->grabF
);
638 WMRealizeWidget(panel
->box
);
639 WMMapSubwidgets(panel
->box
);
644 static void storeCommandInScript(const char *cmd
, const char *line
)
650 path
= wstrconcat(wusergnusteppath(), "/Library/WindowMaker/autostart");
652 f
= fopen(path
, "rb");
654 f
= fopen(path
, "wb");
656 werror(_("could not create %s"), path
);
659 fprintf(f
, "#!/bin/sh\n");
663 int len
= strlen(cmd
);
668 tmppath
= wstrconcat(wusergnusteppath(), "/Library/WindowMaker/autostart.tmp");
669 fo
= fopen(tmppath
, "wb");
671 werror(_("could not create temporary file %s"), tmppath
);
677 if (!fgets(buffer
, 127, f
)) {
680 if (buffer
[0] == '\n') {
681 /* don't write empty lines, else the file will grow
682 * indefinitely (one '\n' added at end of file on each save).
686 if (strncmp(buffer
, cmd
, len
) == 0) {
703 if (rename(tmppath
, path
) != 0) {
704 werror(_("could not rename file %s to %s"), tmppath
, path
);
708 sprintf(buffer
, "chmod u+x %s", path
);
714 fsync(fileno(f
)); /* this may be rw */
719 static void storeData(_Panel
* panel
)
724 static char *button
[4] = { "None", "OpenApplicationsMenu", "OpenWindowListMenu", "SelectWindows" };
725 static char *wheel
[2] = { "None", "SwitchWorkspaces" };
726 WMUserDefaults
*udb
= WMGetStandardUserDefaults();
728 if (!WMGetUDBoolForKey(udb
, "NoXSetStuff")) {
729 tmp
= WMGetTextFieldText(panel
->threT
);
730 if (strlen(tmp
) == 0) {
735 sprintf(buffer
, XSET
" m %i/%i %s\n", (int)(panel
->acceleration
* 10), 10, tmp
);
736 storeCommandInScript(XSET
" m", buffer
);
741 tmp
= WMGetTextFieldText(panel
->ddelaT
);
742 if (sscanf(tmp
, "%i", &i
) == 1 && i
> 0)
743 SetIntegerForKey(i
, "DoubleClickTime");
745 SetBoolForKey(WMGetButtonSelected(panel
->disaB
), "DisableWSMouseActions");
747 i
= WMGetPopUpButtonSelectedItem(panel
->button1P
);
748 SetStringForKey(button
[i
], "MouseLeftButtonAction");
750 i
= WMGetPopUpButtonSelectedItem(panel
->button2P
);
751 SetStringForKey(button
[i
], "MouseMiddleButtonAction");
753 i
= WMGetPopUpButtonSelectedItem(panel
->button3P
);
754 SetStringForKey(button
[i
], "MouseRightButtonAction");
756 i
= WMGetPopUpButtonSelectedItem(panel
->wheelP
);
757 SetStringForKey(wheel
[i
], "MouseWheelAction");
759 tmp
= WMGetPopUpButtonItem(panel
->grabP
, WMGetPopUpButtonSelectedItem(panel
->grabP
));
761 p
= strchr(tmp
, ' ');
764 SetStringForKey(tmp
, "ModifierKey");
769 Panel
*InitMouseSettings(WMScreen
* scr
, WMWidget
* parent
)
773 modifierNames
[0] = wstrdup(_("Shift"));
774 modifierNames
[1] = wstrdup(_("Lock"));
775 modifierNames
[2] = wstrdup(_("Control"));
776 modifierNames
[3] = wstrdup(_("Mod1"));
777 modifierNames
[4] = wstrdup(_("Mod2"));
778 modifierNames
[5] = wstrdup(_("Mod3"));
779 modifierNames
[6] = wstrdup(_("Mod4"));
780 modifierNames
[7] = wstrdup(_("Mod5"));
782 buttonActions
[0] = wstrdup(_("None"));
783 buttonActions
[1] = wstrdup(_("Applications Menu"));
784 buttonActions
[2] = wstrdup(_("Window List Menu"));
785 buttonActions
[3] = wstrdup(_("Select Windows"));
787 wheelActions
[0] = wstrdup(_("None"));
788 wheelActions
[1] = wstrdup(_("Switch Workspaces"));
790 panel
= wmalloc(sizeof(_Panel
));
792 panel
->sectionName
= _("Mouse Preferences");
794 panel
->description
= _("Mouse speed/acceleration, double click delay,\n" "mouse button bindings etc.");
796 panel
->parent
= parent
;
798 panel
->callbacks
.createWidgets
= createPanel
;
799 panel
->callbacks
.updateDomain
= storeData
;
801 AddSection(panel
, ICON_FILE
);