mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Buttons in filepanel.
This commit is contained in:
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -204,8 +204,6 @@ typedef struct W_Screen {
|
|||||||
|
|
||||||
struct W_Pixmap *disketteIcon;
|
struct W_Pixmap *disketteIcon;
|
||||||
struct W_Pixmap *altDisketteIcon;
|
struct W_Pixmap *altDisketteIcon;
|
||||||
struct W_Pixmap *mountIcon;
|
|
||||||
struct W_Pixmap *altMountIcon;
|
|
||||||
struct W_Pixmap *unmountIcon;
|
struct W_Pixmap *unmountIcon;
|
||||||
struct W_Pixmap *altUnmountIcon;
|
struct W_Pixmap *altUnmountIcon;
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ typedef struct W_FilePanel {
|
|||||||
WMButton *trashcanButton;
|
WMButton *trashcanButton;
|
||||||
WMButton *createDirButton;
|
WMButton *createDirButton;
|
||||||
WMButton *disketteButton;
|
WMButton *disketteButton;
|
||||||
WMButton *mountButton;
|
WMButton *unmountButton;
|
||||||
|
|
||||||
WMView *accessoryView;
|
WMView *accessoryView;
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ static void goHome();
|
|||||||
|
|
||||||
static void goFloppy();
|
static void goFloppy();
|
||||||
|
|
||||||
static void goMount();
|
static void goUnmount();
|
||||||
|
|
||||||
static void buttonClick();
|
static void buttonClick();
|
||||||
|
|
||||||
@@ -286,15 +286,14 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
|
|||||||
WMSetButtonAltImage(fPtr->disketteButton, scrPtr->altDisketteIcon);
|
WMSetButtonAltImage(fPtr->disketteButton, scrPtr->altDisketteIcon);
|
||||||
WMSetButtonAction(fPtr->disketteButton, goFloppy, fPtr);
|
WMSetButtonAction(fPtr->disketteButton, goFloppy, fPtr);
|
||||||
|
|
||||||
/*
|
fPtr->unmountButton = WMCreateCommandButton(fPtr->win);
|
||||||
fPtr->mountButton = WMCreateCommandButton(fPtr->win);
|
WMMoveWidget(fPtr->unmountButton, 127, 325);
|
||||||
WMMoveWidget(fPtr->mountButton, 127, 325);
|
WMResizeWidget(fPtr->unmountButton, 28, 28);
|
||||||
WMResizeWidget(fPtr->mountButton, 28, 28);
|
WMSetButtonImagePosition(fPtr->unmountButton, WIPImageOnly);
|
||||||
WMSetButtonImagePosition(fPtr->mountButton, WIPImageOnly);
|
WMSetButtonImage(fPtr->unmountButton, scrPtr->unmountIcon);
|
||||||
WMSetButtonImage(fPtr->mountButton, scrPtr->mountIcon);
|
WMSetButtonAltImage(fPtr->unmountButton, scrPtr->altUnmountIcon);
|
||||||
WMSetButtonAltImage(fPtr->mountButton, scrPtr->altMountIcon);
|
WMSetButtonAction(fPtr->unmountButton, goUnmount, fPtr);
|
||||||
WMSetButtonAction(fPtr->mountButton, goMount, fPtr);
|
WMSetButtonEnabled(fPtr->unmountButton, False);
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
WMRealizeWidget(fPtr->win);
|
WMRealizeWidget(fPtr->win);
|
||||||
@@ -738,7 +737,7 @@ deleteFile(WMButton *bPre, WMFilePanel *panel)
|
|||||||
for (i = 2;s[i] == '/';i++);
|
for (i = 2;s[i] == '/';i++);
|
||||||
strcpy(s, &s[i-1]);
|
strcpy(s, &s[i-1]);
|
||||||
}
|
}
|
||||||
if ((s = strrchr(file, '/')) && !s[1]) s[0] = 0;
|
if (strlen(file) > 1 && (s = strrchr(file, '/')) && !s[1]) s[0] = 0;
|
||||||
|
|
||||||
if (stat(file,&filestat)) {
|
if (stat(file,&filestat)) {
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
@@ -778,7 +777,7 @@ deleteFile(WMButton *bPre, WMFilePanel *panel)
|
|||||||
showError(scr, panel->win, "Permission denied.", NULL);
|
showError(scr, panel->win, "Permission denied.", NULL);
|
||||||
break;
|
break;
|
||||||
case ENOENT:
|
case ENOENT:
|
||||||
showError(scr, panel->win, "'%s' does not exist.", file);
|
showError(scr, panel->win, "Directory '%s' does not exist.", file);
|
||||||
break;
|
break;
|
||||||
case ENOTEMPTY:
|
case ENOTEMPTY:
|
||||||
showError(scr, panel->win, "Directory '%s' is not empty.", file);
|
showError(scr, panel->win, "Directory '%s' is not empty.", file);
|
||||||
@@ -827,7 +826,7 @@ deleteFile(WMButton *bPre, WMFilePanel *panel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
goMount(WMButton *bPtr, WMFilePanel *panel)
|
goUnmount(WMButton *bPtr, WMFilePanel *panel)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -895,9 +894,7 @@ handleEvents(XEvent *event, void *data)
|
|||||||
WMMoveWidget(pPtr->createDirButton, 37, newHeight-(PHEIGHT-325));
|
WMMoveWidget(pPtr->createDirButton, 37, newHeight-(PHEIGHT-325));
|
||||||
WMMoveWidget(pPtr->homeButton, 67, newHeight-(PHEIGHT-325));
|
WMMoveWidget(pPtr->homeButton, 67, newHeight-(PHEIGHT-325));
|
||||||
WMMoveWidget(pPtr->disketteButton, 97, newHeight-(PHEIGHT-325));
|
WMMoveWidget(pPtr->disketteButton, 97, newHeight-(PHEIGHT-325));
|
||||||
/*
|
WMMoveWidget(pPtr->unmountButton, 127, newHeight-(PHEIGHT-325));
|
||||||
WMMoveWidget(pPtr->mountButton, 127, newHeight-(PHEIGHT-325));
|
|
||||||
*/
|
|
||||||
|
|
||||||
newColumnCount = (newWidth - 14) / 140;
|
newColumnCount = (newWidth - 14) / 140;
|
||||||
WMSetBrowserMaxVisibleColumns(pPtr->browser, newColumnCount);
|
WMSetBrowserMaxVisibleColumns(pPtr->browser, newColumnCount);
|
||||||
|
|||||||
@@ -453,21 +453,12 @@ loadPixmaps(WMScreen *scr)
|
|||||||
RCombineImageWithColor(tmp, &white);
|
RCombineImageWithColor(tmp, &white);
|
||||||
scr->altDisketteIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
|
scr->altDisketteIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
|
||||||
RDestroyImage(tmp);
|
RDestroyImage(tmp);
|
||||||
/* mount */
|
|
||||||
tmp = RGetSubImage(image, 0, 80, 24, 24);
|
|
||||||
RCombineImageWithColor(tmp, &white);
|
|
||||||
scr->mountIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
|
|
||||||
RDestroyImage(tmp);
|
|
||||||
tmp = RGetSubImage(image, 0, 80, 24, 24);
|
|
||||||
RCombineImageWithColor(tmp, &white);
|
|
||||||
scr->altMountIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
|
|
||||||
RDestroyImage(tmp);
|
|
||||||
/* unmount */
|
/* unmount */
|
||||||
tmp = RGetSubImage(image, 48, 80, 24, 24);
|
tmp = RGetSubImage(image, 0, 80, 24, 24);
|
||||||
RCombineImageWithColor(tmp, &white);
|
RCombineImageWithColor(tmp, &white);
|
||||||
scr->unmountIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
|
scr->unmountIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
|
||||||
RDestroyImage(tmp);
|
RDestroyImage(tmp);
|
||||||
tmp = RGetSubImage(image, 48, 80, 24, 24);
|
tmp = RGetSubImage(image, 0, 80, 24, 24);
|
||||||
RCombineImageWithColor(tmp, &white);
|
RCombineImageWithColor(tmp, &white);
|
||||||
scr->altUnmountIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
|
scr->altUnmountIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
|
||||||
RDestroyImage(tmp);
|
RDestroyImage(tmp);
|
||||||
|
|||||||
Reference in New Issue
Block a user