dasher r3443 - in trunk/Src/Win32: . Widgets



Author: pcowans
Date: Sun Mar  2 22:36:55 2008
New Revision: 3443
URL: http://svn.gnome.org/viewvc/dasher?rev=3443&view=rev

Log:
* Added toolbar button to allow access to prefernces in direct mode.

Modified:
   trunk/Src/Win32/Dasher.rc
   trunk/Src/Win32/DasherWindow.cpp
   trunk/Src/Win32/DasherWindow.h
   trunk/Src/Win32/Widgets/Toolbar.cpp
   trunk/Src/Win32/resource.h

Modified: trunk/Src/Win32/Dasher.rc
==============================================================================
--- trunk/Src/Win32/Dasher.rc	(original)
+++ trunk/Src/Win32/Dasher.rc	Sun Mar  2 22:36:55 2008
@@ -508,6 +508,7 @@
     IDS_BUTTON_PREFS_DIALOGUE_TITLE "Button Mode Preferences"
     IDS_BUTTON_SETTINGS_TITLE "Button Setup"
     IDS_FILE_SAVE           "Save"
+    IDS_OPTIONS_PREFS       "Prefs"
     IDS_FILE_OPEN           "Open"
     IDS_FILE_NEW            "New"
 END

Modified: trunk/Src/Win32/DasherWindow.cpp
==============================================================================
--- trunk/Src/Win32/DasherWindow.cpp	(original)
+++ trunk/Src/Win32/DasherWindow.cpp	Sun Mar  2 22:36:55 2008
@@ -63,9 +63,11 @@
   wc.m_wc.hCursor = LoadCursor(NULL, IDC_ARROW);
   wc.m_wc.hbrBackground = (HBRUSH) (COLOR_WINDOW); 
  #ifndef _WIN32_WCE
-  wc.m_wc.lpszMenuName = (LPCTSTR) IDC_DASHER;
+ // wc.m_wc.lpszMenuName = (LPCTSTR) IDC_DASHER;
   wc.m_wc.hIconSm = m_hIconSm;
 #endif
+
+  m_hMenu = LoadMenu(WinHelper::hInstApp, (LPCTSTR) IDC_DASHER);
 }
 
 HWND CDasherWindow::Create() {
@@ -81,14 +83,20 @@
   HWND hWnd;
 
 #ifndef _WIN32_WCE
-  if((iStyle == APP_STYLE_COMPOSE) || (iStyle == APP_STYLE_DIRECT))
+  if((iStyle == APP_STYLE_COMPOSE) || (iStyle == APP_STYLE_DIRECT)) {
     hWnd = CWindowImpl<CDasherWindow >::Create(NULL, NULL, WindowTitle.c_str(), WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,  WS_EX_NOACTIVATE | WS_EX_APPWINDOW | WS_EX_TOPMOST);
-  else
+    ::SetMenu(hWnd, NULL);
+  }
+  else {
     hWnd = CWindowImpl<CDasherWindow >::Create(NULL, NULL, WindowTitle.c_str(), WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN);
+    ::SetMenu(hWnd, m_hMenu);
+  }
 #else
   hWnd = CWindowImpl<CDasherWindow, CWindow, CWinTraits<WS_CLIPCHILDREN | WS_CLIPSIBLINGS> >::Create(NULL);
 #endif
 
+
+
   // Create Widgets
   m_pDasher = new CDasher(hWnd);
 
@@ -572,10 +580,12 @@
   if((iStyle == APP_STYLE_COMPOSE) || (iStyle == APP_STYLE_DIRECT)) {
     SetWindowLong(GWL_EXSTYLE, GetWindowLong(GWL_EXSTYLE) | WS_EX_NOACTIVATE | WS_EX_APPWINDOW);
     SetWindowPos(HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+	SetMenu(NULL);
   }
   else {
     SetWindowLong(GWL_EXSTYLE, GetWindowLong(GWL_EXSTYLE) & !WS_EX_NOACTIVATE);
     SetWindowPos(HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+	SetMenu(m_hMenu);
   }
 #endif
 

Modified: trunk/Src/Win32/DasherWindow.h
==============================================================================
--- trunk/Src/Win32/DasherWindow.h	(original)
+++ trunk/Src/Win32/DasherWindow.h	Sun Mar  2 22:36:55 2008
@@ -125,6 +125,8 @@
 
 	HICON m_hIconSm;
 
+	HMENU m_hMenu;
+
 	LPCWSTR AutoOffset;
 	LPCWSTR DialogCaption;
 	char tmpAutoOffset[25];

Modified: trunk/Src/Win32/Widgets/Toolbar.cpp
==============================================================================
--- trunk/Src/Win32/Widgets/Toolbar.cpp	(original)
+++ trunk/Src/Win32/Widgets/Toolbar.cpp	Sun Mar  2 22:36:55 2008
@@ -38,7 +38,9 @@
   {STD_CUT, 3, IDS_EDIT_CUT, ID_EDIT_CUT},
   {STD_COPY, 4, IDS_EDIT_COPY, ID_EDIT_COPY},
   {-2, 5, IDS_EDIT_COPY_ALL, ID_EDIT_COPY_ALL},
-  {STD_PASTE, 6, IDS_EDIT_PASTE, ID_EDIT_PASTE}
+  {STD_PASTE, 6, IDS_EDIT_PASTE, ID_EDIT_PASTE},
+  {-1, -1, 0, 0},
+  {STD_PROPERTIES, 7, IDS_OPTIONS_PREFS, ID_OPTIONS_PREFS}
 };
 
 CToolbar::CToolbar(HWND hParent, bool bVisible) {

Modified: trunk/Src/Win32/resource.h
==============================================================================
--- trunk/Src/Win32/resource.h	(original)
+++ trunk/Src/Win32/resource.h	Sun Mar  2 22:36:55 2008
@@ -13,6 +13,7 @@
 #define IDS_BUTTON_SETTINGS_TITLE       106
 #define IDS_FILE_SAVE                   107
 #define IDM_EXIT                        108
+#define IDS_OPTIONS_PREFS               108
 #define IDS_FILE_OPEN                   109
 #define IDS_HELLO                       110
 #define IDS_FILE_NEW                    111



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]