1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 21:08:08 +01:00

kbd shortcuts for icon dialog

This commit is contained in:
kojima
2001-02-17 22:46:29 +00:00
parent b04c4ea500
commit 57bc9c54f3
4 changed files with 97 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ Changes since version 0.64.0:
- added better appicon handling of apps of the same type - added better appicon handling of apps of the same type
- applied patch for wkdemenu (Malcolm Cowe <malk@bruhaha.co.uk>) - applied patch for wkdemenu (Malcolm Cowe <malk@bruhaha.co.uk>)
- added WINDOWS_MENU submenu type for root menu (Bastien Nocera <hadess@hadess.net>) - added WINDOWS_MENU submenu type for root menu (Bastien Nocera <hadess@hadess.net>)
- added kbd shortcuts for icon chooser
Changes since version 0.63.1: Changes since version 0.63.1:
............................. .............................

2
TODO
View File

@@ -14,7 +14,6 @@ Need to do:
=========== ===========
- put a "Do not save workspace state" in the exit confirmation dialog - put a "Do not save workspace state" in the exit confirmation dialog
- allow user to select/restore default root menu from wprefs - allow user to select/restore default root menu from wprefs
- fix windoze cycle window patch
- support for X11R6.4 extension for getting extra visual info in wrlib's - support for X11R6.4 extension for getting extra visual info in wrlib's
automatic best context guessing automatic best context guessing
- docklet to control AccessX (keyboard accessibility) functions - docklet to control AccessX (keyboard accessibility) functions
@@ -22,7 +21,6 @@ Need to do:
- add function to directly make a thumbnail of an image, using the - add function to directly make a thumbnail of an image, using the
functionality provided by the image libraries to load a minimal functionality provided by the image libraries to load a minimal
amount of data. amount of data.
+ investigate memory leaks
- rewrite defaults/wdefaults stuff to use WINGs UD stuff. Search list: - rewrite defaults/wdefaults stuff to use WINGs UD stuff. Search list:
~/G/D/WindowMaker /u/l/s/W/D/WindowMaker built-in-defaults ~/G/D/WindowMaker /u/l/s/W/D/WindowMaker built-in-defaults
- remake internal string processing to use wchar? unicode? - remake internal string processing to use wchar? unicode?

View File

@@ -385,7 +385,7 @@ wAppIconIsFirstInstance(WAppIcon *icon)
int index = 0; int index = 0;
if (!WFLAGP(icon->icon->owner, collapse_appicons)) if (!WFLAGP(icon->icon->owner, collapse_appicons))
return False; return True;
while (list) { while (list) {
if (icon == list) if (icon == list)

View File

@@ -292,7 +292,11 @@ listCallback(void *self, void *data)
char *path; char *path;
if (lPtr==panel->dirList) { if (lPtr==panel->dirList) {
path = WMGetListSelectedItem(lPtr)->text; WMListItem *item = WMGetListSelectedItem(lPtr);
if (item == NULL)
return;
path = item->text;
WMSetTextFieldText(panel->fileField, path); WMSetTextFieldText(panel->fileField, path);
@@ -304,11 +308,17 @@ listCallback(void *self, void *data)
listPixmaps(panel->scr, panel->iconList, path); listPixmaps(panel->scr, panel->iconList, path);
} else { } else {
char *tmp, *iconFile; char *tmp, *iconFile;
WMListItem *item = WMGetListSelectedItem(panel->dirList);
path = WMGetListSelectedItem(panel->dirList)->text; if (item == NULL)
return;
path = item->text;
tmp = wexpandpath(path); tmp = wexpandpath(path);
iconFile = WMGetListSelectedItem(panel->iconList)->text; item = WMGetListSelectedItem(panel->iconList);
if (item == NULL)
return;
iconFile = item->text;
path = wmalloc(strlen(tmp)+strlen(iconFile)+4); path = wmalloc(strlen(tmp)+strlen(iconFile)+4);
strcpy(path, tmp); strcpy(path, tmp);
@@ -477,6 +487,83 @@ buttonCallback(void *self, void *clientData)
} }
static void
keyPressHandler(XEvent *event, void *data)
{
IconPanel *panel = (IconPanel*)data;
Display *dpy = event->xany.display;
char buffer[32];
int count;
KeySym ksym;
int iidx;
int didx;
int item;
WMList *list = NULL;
if (event->type == KeyRelease)
return;
buffer[0] = 0;
count = XLookupString(&event->xkey, buffer, sizeof(buffer), &ksym, NULL);
iidx = WMGetListSelectedItemRow(panel->iconList);
didx = WMGetListSelectedItemRow(panel->dirList);
switch (ksym) {
case XK_Up:
if (iidx > 0)
item = iidx-1;
else
item = iidx;
list = panel->iconList;
break;
case XK_Down:
if (iidx < WMGetListNumberOfRows(panel->iconList) - 1)
item = iidx+1;
else
item = iidx;
list = panel->iconList;
break;
case XK_Home:
item = 0;
list = panel->iconList;
break;
case XK_End:
item = WMGetListNumberOfRows(panel->iconList) - 1;
list = panel->iconList;
break;
case XK_Next:
if (didx < WMGetListNumberOfRows(panel->dirList) - 1)
item = didx + 1;
else
item = didx;
list = panel->dirList;
break;
case XK_Prior:
if (didx > 0)
item = didx - 1;
else
item = 0;
list = panel->dirList;
break;
case XK_Return:
WMPerformButtonClick(panel->okButton);
break;
case XK_Escape:
WMPerformButtonClick(panel->cancelButton);
break;
}
if (list) {
WMSelectListItem(list, item);
WMSetListPosition(list, item - 5);
listCallback(list, panel);
}
}
Bool Bool
wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class) wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
{ {
@@ -494,6 +581,10 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
panel->win = WMCreateWindow(scr->wmscreen, "iconChooser"); panel->win = WMCreateWindow(scr->wmscreen, "iconChooser");
WMResizeWidget(panel->win, 450, 280); WMResizeWidget(panel->win, 450, 280);
WMCreateEventHandler(WMWidgetView(panel->win), KeyPressMask|KeyReleaseMask,
keyPressHandler, panel);
boldFont = WMBoldSystemFontOfSize(scr->wmscreen, 12); boldFont = WMBoldSystemFontOfSize(scr->wmscreen, 12);
panel->normalfont = WMSystemFontOfSize(WMWidgetScreen(panel->win), 12); panel->normalfont = WMSystemFontOfSize(WMWidgetScreen(panel->win), 12);
@@ -558,6 +649,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
WMSetLabelText(panel->fileLabel, _("File Name:")); WMSetLabelText(panel->fileLabel, _("File Name:"));
panel->fileField = WMCreateTextField(panel->win); panel->fileField = WMCreateTextField(panel->win);
WMSetViewNextResponder(WMWidgetView(panel->fileField), WMWidgetView(panel->win));
WMResizeWidget(panel->fileField, 345, 20); WMResizeWidget(panel->fileField, 345, 20);
WMMoveWidget(panel->fileField, 95, 210); WMMoveWidget(panel->fileField, 95, 210);
WMSetTextFieldEditable(panel->fileField, False); WMSetTextFieldEditable(panel->fileField, False);