- "up" button (no functionality yet)
authorMartin Fuchs <fuchs.martin@gmail.com>
Sat, 28 Feb 2004 18:10:03 +0000 (18:10 +0000)
committerMartin Fuchs <fuchs.martin@gmail.com>
Sat, 28 Feb 2004 18:10:03 +0000 (18:10 +0000)
- moved extra functions into new "special" toolbar

svn path=/trunk/; revision=8456

reactos/subsys/system/explorer/explorer.h
reactos/subsys/system/explorer/explorer_intres.h
reactos/subsys/system/explorer/explorer_intres.rc
reactos/subsys/system/explorer/res/toolbar.bmp
reactos/subsys/system/explorer/shell/filechild.cpp
reactos/subsys/system/explorer/shell/mainframe.cpp
reactos/subsys/system/explorer/shell/mainframe.h
reactos/subsys/system/explorer/shell/shellbrowser.cpp
reactos/subsys/system/explorer/shell/webchild.cpp

index 6148f26..31c69f1 100644 (file)
 
 #define        IDW_STATUSBAR                   0x100
 #define        IDW_TOOLBAR                             0x101
-#define        IDW_DRIVEBAR                    0x102
-#define        IDW_ADDRESSBAR                  0x103
-#define        IDW_COMMANDBAR                  0x104
+#define        IDW_EXTRABAR                    0x102
+#define        IDW_DRIVEBAR                    0x103
+#define        IDW_ADDRESSBAR                  0x104
+#define        IDW_COMMANDBAR                  0x105
 #define        IDW_FIRST_CHILD                 0xC000  /*0x200*/
 
 
index 870b0fb..7613ac5 100644 (file)
@@ -95,6 +95,7 @@
 #define ID_VIEW_STATUSBAR               503
 #define ID_VIEW_DRIVE_BAR               507
 #define ID_VIEW_TOOL_BAR                508
+#define ID_VIEW_EXTRA_BAR               509
 #define IDC_ROS_EXPLORER                1000
 #define IDC_ICON_ALIGN_0                1002
 #define IDC_ICON_ALIGN_1                1003
 #define ID_EXPLORE                      40011
 #define ID_SWITCH_DESKTOP_1             50000
 #define ID_TASKMGR                      40012
+#define        ID_BROWSE_UP                    40013
 #define ID_WINDOW_NEW                   0xE130
 #define ID_WINDOW_ARRANGE               0xE131
 #define ID_WINDOW_CASCADE               0xE132
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        161
-#define _APS_NEXT_COMMAND_VALUE         40013
+#define _APS_NEXT_COMMAND_VALUE         40014
 #define _APS_NEXT_CONTROL_VALUE         1003
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
index e307e51..772eb8d 100644 (file)
@@ -35,6 +35,7 @@ BEGIN
     POPUP "&Prezentare"
     BEGIN
         MENUITEM "&Bara cu instrumente",        ID_VIEW_TOOL_BAR
+        MENUITEM "&Extra Bar",                  ID_VIEW_EXTRA_BAR
         MENUITEM "&Drivebar",                   ID_VIEW_DRIVE_BAR, CHECKED
         MENUITEM "&Bara de stare",              ID_VIEW_STATUSBAR
         MENUITEM SEPARATOR
@@ -311,6 +312,7 @@ BEGIN
     POPUP "&Ansicht"
     BEGIN
         MENUITEM "&Toolbar",                    ID_VIEW_TOOL_BAR
+        MENUITEM "&Extra Bar",                  ID_VIEW_EXTRA_BAR
         MENUITEM "Lauf&werkleiste",             ID_VIEW_DRIVE_BAR, CHECKED
         MENUITEM "&Status Bar",                 ID_VIEW_STATUSBAR
         MENUITEM SEPARATOR
@@ -540,6 +542,7 @@ BEGIN
     POPUP "&View"
     BEGIN
         MENUITEM "&Toolbar",                    ID_VIEW_TOOL_BAR
+        MENUITEM "&Extra Bar",                  ID_VIEW_EXTRA_BAR
         MENUITEM "&Drivebar",                   ID_VIEW_DRIVE_BAR, CHECKED
         MENUITEM "&Status Bar",                 ID_VIEW_STATUSBAR
         MENUITEM SEPARATOR
@@ -888,6 +891,7 @@ BEGIN
     POPUP "&Affichage"
     BEGIN
         MENUITEM "Barre d'&outils",             ID_VIEW_TOOL_BAR
+        MENUITEM "&Extra Bar",                  ID_VIEW_EXTRA_BAR
         MENUITEM "&Drivebar",                   ID_VIEW_DRIVE_BAR, CHECKED
         MENUITEM "Barre d'&état",               ID_VIEW_STATUSBAR
         MENUITEM SEPARATOR
index 632b1ec..7e88726 100644 (file)
Binary files a/reactos/subsys/system/explorer/res/toolbar.bmp and b/reactos/subsys/system/explorer/res/toolbar.bmp differ
index ddb78ac..b3e596f 100644 (file)
@@ -439,6 +439,15 @@ LRESULT FileChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
                                activate_entry(pane, _hwnd);
                                break;}
 
+                         case ID_BROWSE_BACK:
+                               break;//@todo
+
+                         case ID_BROWSE_FORWARD:
+                               break;//@todo
+
+                         case ID_BROWSE_UP:
+                               break;//@todo
+
                          default:
                                return pane->command(LOWORD(wparam));
                        }
index feae501..3b7ae32 100644 (file)
@@ -64,7 +64,9 @@ MainFrame::MainFrame(HWND hwnd)
 #endif
 
        TBBUTTON toolbarBtns[] = {
+#ifdef _NO_REBAR
                {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
+#endif
                {0, ID_WINDOW_NEW, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
                {1, ID_WINDOW_CASCADE, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
                {2, ID_WINDOW_TILE_HORZ, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
@@ -76,106 +78,115 @@ MainFrame::MainFrame(HWND hwnd)
                {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
                {7, ID_BROWSE_BACK, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
                {8, ID_BROWSE_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
-               {9, ID_BROWSE_HOME, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
-               {10, ID_BROWSE_SEARCH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
-               {11, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
-               {12, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
+               {9, ID_BROWSE_UP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
+               {10, ID_BROWSE_HOME, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
+               {11, ID_BROWSE_SEARCH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
+               {12, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
+               {13, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
        };
 
        _htoolbar = CreateToolbarEx(hwnd, 
 #ifndef _NO_REBAR
                CCS_NOPARENTALIGN|CCS_NORESIZE|
 #endif
-               WS_CHILD|WS_VISIBLE, IDW_TOOLBAR, 2, g_Globals._hInstance, IDB_TOOLBAR, toolbarBtns,
-               sizeof(toolbarBtns)/sizeof(TBBUTTON), 16, 15, 16, 15, sizeof(TBBUTTON));
+               WS_CHILD|WS_VISIBLE, IDW_TOOLBAR, 2, g_Globals._hInstance, IDB_TOOLBAR,
+               toolbarBtns, sizeof(toolbarBtns)/sizeof(TBBUTTON),
+               16, 15, 16, 15, sizeof(TBBUTTON));
 
        CheckMenuItem(_menu_info._hMenuView, ID_VIEW_TOOL_BAR, MF_BYCOMMAND|MF_CHECKED);
 
 
-       TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
-       int btn = 1;
-       PTSTR p;
+       TBBUTTON extraBtns = {0, 0, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
 
-       _hdrivebar = CreateToolbarEx(hwnd,
 #ifndef _NO_REBAR
+       _hextrabar = CreateToolbarEx(hwnd,
                                CCS_NOPARENTALIGN|CCS_NORESIZE|
-#endif
                                WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
-                               IDW_DRIVEBAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, &drivebarBtn,
-                               1, 16, 13, 16, 13, sizeof(TBBUTTON));
-       CheckMenuItem(_menu_info._hMenuView, ID_VIEW_DRIVE_BAR, MF_BYCOMMAND|MF_CHECKED);
+                               IDW_EXTRABAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, NULL, 0,
+                               16, 13, 16, 13, sizeof(TBBUTTON));
+#else
+       _hextrabar = CreateToolbarEx(hwnd,
+                               WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
+                               IDW_EXTRABAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, &extraBtns, 1,
+                               16, 13, 16, 13, sizeof(TBBUTTON));
+#endif
 
+       CheckMenuItem(_menu_info._hMenuView, ID_VIEW_EXTRA_BAR, MF_BYCOMMAND|MF_CHECKED);
 
-       GetLogicalDriveStrings(BUFFER_LEN, _drives);
 
-       drivebarBtn.fsStyle = BTNS_BUTTON;
+       extraBtns.fsStyle = BTNS_BUTTON;
 
 #ifdef __WINE__
         // insert unix file system button
-       SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("/\0"));
-
-       drivebarBtn.idCommand = ID_DRIVE_UNIX_FS;
-       SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
-       ++drivebarBtn.iString;
+       extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("/\0"));
+       extraBtns.idCommand = ID_DRIVE_UNIX_FS;
+       SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
 #endif
 
         // insert explorer window button
-       SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("Explore\0"));
-
-       drivebarBtn.idCommand = ID_DRIVE_DESKTOP;
-       SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
-       ++drivebarBtn.iString;
+       extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Explore\0"));
+       extraBtns.idCommand = ID_DRIVE_DESKTOP;
+       SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
 
         // insert shell namespace button
-       SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("Shell\0"));
+       extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Shell\0"));
+       extraBtns.idCommand = ID_DRIVE_SHELL_NS;
+       SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
 
-       drivebarBtn.idCommand = ID_DRIVE_SHELL_NS;
-       SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
-       ++drivebarBtn.iString;
+        // insert web control button
+       extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Web\0"));
+       extraBtns.idCommand = ID_WEB_WINDOW;
+       SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
 
 #define        W_VER_NT 0
        if ((HIWORD(GetVersion())>>14) == W_VER_NT) {
                 // insert NT object namespace button
-               SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("NT Obj\0"));
-
-               drivebarBtn.idCommand = ID_DRIVE_NTOBJ_NS;
-               SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
-               ++drivebarBtn.iString;
+               extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("NT Obj\0"));
+               extraBtns.idCommand = ID_DRIVE_NTOBJ_NS;
+               SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
        }
 
         // insert Registry button
-       SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("Reg.\0"));
-
-       drivebarBtn.idCommand = ID_DRIVE_REGISTRY;
-       SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
-       ++drivebarBtn.iString;
+       extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Reg.\0"));
+       extraBtns.idCommand = ID_DRIVE_REGISTRY;
+       SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
 
 #ifdef _DEBUG
         // insert FAT direct file system access button
-       SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("FAT\0"));
+       extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("FAT\0"));
+       extraBtns.idCommand = ID_DRIVE_FAT;
+       SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
+#endif
 
-       drivebarBtn.idCommand = ID_DRIVE_FAT;
-       SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
-       ++drivebarBtn.iString;
+
+       TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
+       PTSTR p;
+
+#ifndef _NO_REBAR
+       _hdrivebar = CreateToolbarEx(hwnd,
+                               CCS_NOPARENTALIGN|CCS_NORESIZE|
+                               WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
+                               IDW_DRIVEBAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, NULL, 0,
+                               16, 13, 16, 13, sizeof(TBBUTTON));
+#else
+       _hdrivebar = CreateToolbarEx(hwnd,
+                               WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
+                               IDW_DRIVEBAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, &drivebarBtn, 1,
+                               16, 13, 16, 13, sizeof(TBBUTTON));
 #endif
 
-        // insert web control button
-       SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)TEXT("Web\0"));
+       CheckMenuItem(_menu_info._hMenuView, ID_VIEW_DRIVE_BAR, MF_BYCOMMAND|MF_CHECKED);
+
 
-       drivebarBtn.idCommand = ID_WEB_WINDOW;
-       SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
-       ++drivebarBtn.iString;
+       GetLogicalDriveStrings(BUFFER_LEN, _drives);
 
         // register windows drive root strings
        SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)_drives);
 
+       drivebarBtn.fsStyle = BTNS_BUTTON;
        drivebarBtn.idCommand = ID_DRIVE_FIRST;
 
        for(p=_drives; *p; ) {
-                // insert drive letter
-               TCHAR b[3] = {tolower(*p)};
-               SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)b);
-
                switch(GetDriveType(p)) {
                        case DRIVE_REMOVABLE:   drivebarBtn.iBitmap = 1;        break;
                        case DRIVE_CDROM:               drivebarBtn.iBitmap = 3;        break;
@@ -184,7 +195,7 @@ MainFrame::MainFrame(HWND hwnd)
                        default:/*DRIVE_FIXED*/ drivebarBtn.iBitmap = 2;
                }
 
-               SendMessage(_hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
+               SendMessage(_hdrivebar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&drivebarBtn);
                ++drivebarBtn.idCommand;
                ++drivebarBtn.iString;
 
@@ -209,7 +220,7 @@ MainFrame::MainFrame(HWND hwnd)
 #ifndef RBBS_HIDETITLE // missing in MinGW headers as of 25.02.2004
 #define RBBS_HIDETITLE 0x400
 #endif
-       rbBand.fStyle = RBBS_CHILDEDGE|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE; //|RBBS_BREAK
+       rbBand.fStyle = RBBS_CHILDEDGE|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE;
 
        rbBand.cxMinChild = 0;
        rbBand.cyMinChild = 0;
@@ -221,10 +232,18 @@ MainFrame::MainFrame(HWND hwnd)
        rbBand.hwndChild = _htoolbar;
        rbBand.cxMinChild = 0;
        rbBand.cyMinChild = btn_hgt + 4;
-       rbBand.cx = 280;
+       rbBand.cx = 284;
        SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
 
-       rbBand.lpText = NULL;//TEXT("Drivebar");
+       rbBand.lpText = TEXT("Extras");
+       rbBand.hwndChild = _hextrabar;
+       rbBand.cxMinChild = 0;
+       rbBand.cyMinChild = btn_hgt + 4;
+       rbBand.cx = 284;
+       SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
+
+       rbBand.fStyle |= RBBS_BREAK;
+       rbBand.lpText = TEXT("Drives");
        rbBand.hwndChild = _hdrivebar;
        rbBand.cxMinChild = 0;
        rbBand.cyMinChild = btn_hgt + 4;
@@ -571,6 +590,10 @@ int MainFrame::Command(int id, int code)
                toggle_child(_hwnd, id, _htoolbar);
                break;
 
+         case ID_VIEW_EXTRA_BAR:
+               toggle_child(_hwnd, id, _hextrabar);
+               break;
+
          case ID_VIEW_DRIVE_BAR:
                toggle_child(_hwnd, id, _hdrivebar);
                break;
@@ -743,6 +766,15 @@ void MainFrame::resize_frame_rect(PRECT prect)
                //      prect->bottom -= rt.bottom+3;
                }
 
+               if (IsWindowVisible(_hextrabar)) {
+                       SendMessage(_hextrabar, WM_SIZE, 0, 0);
+                       ClientRect rt(_hextrabar);
+                       int new_top = --prect->top + rt.bottom+3;
+                       MoveWindow(_hextrabar, 0, prect->top, rt.right, new_top, TRUE);
+                       prect->top = new_top;
+               //      prect->bottom -= rt.bottom+2;
+               }
+
                if (IsWindowVisible(_hdrivebar)) {
                        SendMessage(_hdrivebar, WM_SIZE, 0, 0);
                        ClientRect rt(_hdrivebar);
index f0b18b4..48d46b2 100644 (file)
@@ -56,6 +56,7 @@ protected:
        WindowHandle _hstatusbar;
        WindowHandle _hwndrebar;
        WindowHandle _htoolbar;
+       WindowHandle _hextrabar;
        WindowHandle _hdrivebar;
        WindowHandle _haddressedit;
        WindowHandle _hcommandedit;
index fe1c9fd..3e4e23f 100644 (file)
@@ -421,6 +421,15 @@ LRESULT ShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
                        ShellBrowserChild::create(_create_info);
                        break;}
 
+                 case ID_BROWSE_BACK:
+                       break;//@todo
+
+                 case ID_BROWSE_FORWARD:
+                       break;//@todo
+
+                 case ID_BROWSE_UP:
+                       break;//@todo
+
                  default:
                        return FALSE;
                }
index ab79723..959d033 100644 (file)
@@ -247,6 +247,10 @@ LRESULT WebChildWindow::WndProc(UINT message, WPARAM wparam, LPARAM lparam)
                                        hr = _control->GoForward();
                                        break;
 
+                                 case ID_BROWSE_UP:
+                                       ///@todo
+                                       break;
+
                                  case ID_BROWSE_HOME:
                                        hr = _control->GoHome();
                                        break;