Author: dquintana
Date: Tue Oct 28 18:32:21 2014
New Revision: 65080

URL: http://svn.reactos.org/svn/reactos?rev=65080&view=rev
Log:
[BROWSEUI]
* Properly return the toolbar status on QueryStatus.
* Properly make use of the returned into from QueryStatus.

Modified:
    branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
    branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp

Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp?rev=65080&r1=65079&r2=65080&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp   
[iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp   
[iso-8859-1] Tue Oct 28 18:32:21 2014
@@ -1155,22 +1155,28 @@
                     prgCmds->cmdf = OLECMDF_SUPPORTED;
                     break;
                 case ITID_TOOLBARBANDSHOWN: // toolbar visibility
-                    prgCmds->cmdf = OLECMDF_SUPPORTED | OLECMDF_ENABLED;
+                    prgCmds->cmdf = OLECMDF_SUPPORTED;
+                    if (fControlsBar)
+                        prgCmds->cmdf |= OLECMDF_LATCHED;
                     break;
                 case ITID_ADDRESSBANDSHOWN: // address bar visibility
-                    prgCmds->cmdf = OLECMDF_SUPPORTED | OLECMDF_ENABLED;
+                    prgCmds->cmdf = OLECMDF_SUPPORTED;
+                    if (fNavigationBar)
+                        prgCmds->cmdf |= OLECMDF_LATCHED;
                     break;
                 case ITID_LINKSBANDSHOWN:   // links bar visibility
                     prgCmds->cmdf = 0;
                     break;
                 case ITID_MENUBANDSHOWN:    // Menubar band visibility
-                    prgCmds->cmdf = 0;
+                    prgCmds->cmdf = OLECMDF_SUPPORTED;
+                    if (fMenuBar)
+                        prgCmds->cmdf |= OLECMDF_LATCHED;
                     break;
                 case ITID_AUTOHIDEENABLED:  // Auto hide enabled/disabled
                     prgCmds->cmdf = 0;
                     break;
                 case ITID_CUSTOMIZEENABLED: // customize enabled
-                    prgCmds->cmdf = OLECMDF_SUPPORTED | OLECMDF_ENABLED;
+                    prgCmds->cmdf = OLECMDF_SUPPORTED;
                     break;
                 case ITID_TOOLBARLOCKED:    // lock toolbars
                     prgCmds->cmdf = OLECMDF_SUPPORTED | OLECMDF_ENABLED;
@@ -1796,12 +1802,18 @@
         default:
             break;
     }
-
-    MENUITEMINFO mii;
-    mii.cbSize = sizeof(mii);
-    mii.fMask = MIIM_STATE;
-    mii.fState = fLocked ? MFS_CHECKED : MFS_UNCHECKED;
-    SetMenuItemInfo(contextMenu, IDM_TOOLBARS_LOCKTOOLBARS, FALSE, &mii);
+    
+    // TODO: Implement show/hide toolbars
+    SHEnableMenuItem(contextMenu, IDM_TOOLBARS_STANDARDBUTTONS, FALSE);
+    SHEnableMenuItem(contextMenu, IDM_TOOLBARS_ADDRESSBAR, FALSE);
+    SHEnableMenuItem(contextMenu, IDM_TOOLBARS_LINKSBAR, FALSE);
+    SHEnableMenuItem(contextMenu, IDM_TOOLBARS_CUSTOMIZE, FALSE);
+
+    SHCheckMenuItem(contextMenu, IDM_TOOLBARS_STANDARDBUTTONS, fControlsBar != 
NULL);
+    SHCheckMenuItem(contextMenu, IDM_TOOLBARS_ADDRESSBAR, fNavigationBar != 
NULL);
+    SHCheckMenuItem(contextMenu, IDM_TOOLBARS_LINKSBAR, FALSE);
+    SHCheckMenuItem(contextMenu, IDM_TOOLBARS_CUSTOMIZE, FALSE);
+    SHCheckMenuItem(contextMenu, IDM_TOOLBARS_LOCKTOOLBARS, fLocked);
 
     // TODO: use GetSystemMetrics(SM_MENUDROPALIGNMENT) to determine menu 
alignment
     command = TrackPopupMenu(contextMenu, TPM_LEFTALIGN | TPM_TOPALIGN | 
TPM_RIGHTBUTTON | TPM_RETURNCMD,

Modified: branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp?rev=65080&r1=65079&r2=65080&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp      
[iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp      
[iso-8859-1] Tue Oct 28 18:32:21 2014
@@ -1570,10 +1570,16 @@
         RemoveMenu(toolbarMenuBar, 0, MF_BYPOSITION);
         DestroyMenu(toolbarMenuBar);
 
-        SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_STANDARDBUTTONS, 
commandList[0].cmdf);
-        SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_ADDRESSBAR, 
commandList[1].cmdf & OLECMDF_ENABLED);
-        SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_LINKSBAR, 
commandList[2].cmdf & OLECMDF_ENABLED);
-        SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_LOCKTOOLBARS, 
commandList[3].cmdf & OLECMDF_ENABLED);
+        // TODO: Implement
+        SHEnableMenuItem(toolbarMenu, IDM_TOOLBARS_STANDARDBUTTONS, 
commandList[0].cmdf & OLECMDF_ENABLED);
+        SHEnableMenuItem(toolbarMenu, IDM_TOOLBARS_ADDRESSBAR, 
commandList[1].cmdf & OLECMDF_ENABLED);
+        SHEnableMenuItem(toolbarMenu, IDM_TOOLBARS_LINKSBAR, 
commandList[2].cmdf & OLECMDF_ENABLED);
+        SHEnableMenuItem(toolbarMenu, IDM_TOOLBARS_CUSTOMIZE, 
commandList[4].cmdf & OLECMDF_ENABLED);
+
+        SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_STANDARDBUTTONS, 
commandList[0].cmdf & OLECMDF_LATCHED);
+        SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_ADDRESSBAR, 
commandList[1].cmdf & OLECMDF_LATCHED);
+        SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_LINKSBAR, 
commandList[2].cmdf & OLECMDF_LATCHED);
+        SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_LOCKTOOLBARS, 
commandList[3].cmdf & OLECMDF_LATCHED);
         if ((commandList[4].cmdf & OLECMDF_ENABLED) == 0)
             DeleteMenu(toolbarMenu, IDM_TOOLBARS_CUSTOMIZE, MF_BYCOMMAND);
         DeleteMenu(toolbarMenu, IDM_TOOLBARS_TEXTLABELS, MF_BYCOMMAND);
@@ -1585,6 +1591,9 @@
         SetMenuItemInfo(theMenu, IDM_VIEW_TOOLBARS, FALSE, &menuItemInfo);
     }
     SHCheckMenuItem(theMenu, IDM_VIEW_STATUSBAR, fStatusBarVisible ? TRUE : 
FALSE);
+
+    // TODO: Implement
+    SHEnableMenuItem(theMenu, IDM_VIEW_EXPLORERBAR, FALSE);
 }
 
 bool IUnknownIsEqual(IUnknown *int1, IUnknown *int2)


Reply via email to