]> git.saurik.com Git - wxWidgets.git/commitdiff
Misc fixes, now menus are almost working on MicroWindows
authorJulian Smart <julian@anthemion.co.uk>
Thu, 5 Jul 2001 13:35:53 +0000 (13:35 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 5 Jul 2001 13:35:53 +0000 (13:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

13 files changed:
include/wx/app.h
include/wx/intl.h
include/wx/univ/setup.h
samples/minimal/makefile.mic
src/common/datetime.cpp
src/common/intl.cpp
src/common/popupcmn.cpp
src/msw/dialog.cpp
src/msw/utils.cpp
src/msw/window.cpp
src/univ/framuniv.cpp
src/univ/menu.cpp
src/univ/themes/win32.cpp

index 8f0b44bbed5d180df57459fef3356438efaf6bfc..cdd0e46cf58d3207b4dd74d437ab27efdf205ee5 100644 (file)
@@ -205,7 +205,7 @@ public:
         // object) - this log object is used by default by all wxLogXXX()
         // functions.
     virtual wxLog *CreateLogTarget()
-        #if wxUSE_GUI && wxUSE_LOGGUI
+        #if wxUSE_GUI && wxUSE_LOGGUI && !defined(__WXMICROWIN__)
             { return new wxLogGui; }
         #else // !GUI
             { return new wxLogStderr; }
index a8e82332770cfb0bff00d3e7706c4cdd4aa065d7..85218152344c755a6fe4bf0bb6d8222ec5e7eadb 100644 (file)
@@ -490,7 +490,9 @@ inline const wxMB2WXbuf wxGetTranslation(const wxChar *sz)
 
 #define wxTRANSLATE(str) _T(str)
 
-inline const wxChar *wxGetTranslation(const wxChar *sz) { return sz; }
+// Note: use of 'inline' here can cause this symbol not to be found when compiled with gcc
+//const wxChar *wxGetTranslation(const wxChar *sz);
+#define wxGetTranslation(sz) sz
 
 #endif // wxUSE_INTL/!wxUSE_INTL
 
index 24f7b684c79209b9c2e329844d956966ecb3c1c1..462c01354eba4e3898fb6c2144945ddfbb76ba91 100644 (file)
 #define wxUSE_DIRDLG 0
 #define wxUSE_FONTDLG 0
 #define wxUSE_FILEDLG 0
-#define wxUSE_TEXTDLG 0
+#define wxUSE_FILEDLG 0
+#define wxUSE_COLOURDLG 0
 #define wxUSE_CHOICEDLG 0
 #define wxUSE_NUMBERDLG 0
 #define wxUSE_STARTUP_TIPS 0
 #define wxUSE_DIRDLG 0
 #define wxUSE_FONTDLG 0
 #define wxUSE_FILEDLG 0
+#define wxUSE_COLOURDLG 0
 #define wxUSE_TEXTDLG 0
 #define wxUSE_CHOICEDLG 0
 #define wxUSE_NUMBERDLG 0
index b366facc34b5e5518a110e969bf262e5e16a33fb..f560e6912d84457eda9d96360566f5a43914790b 100644 (file)
@@ -86,3 +86,6 @@ cleanwx:
 
 wx:
        @pushd $(WXDIR)/src/msw; make -f makefile.mic all; popd
+
+wxfull:
+       @pushd $(WXDIR)/src/msw; make -f makefile.mic cleanwx all; popd
index ab397e793ca9bb6d4582abba31fa08d77ee428c8..672a97e7a96c8cd97a3cf54a427e2af21f91df6f 100644 (file)
 
 #ifndef WX_PRECOMP
     #include "wx/string.h"
-    #include "wx/intl.h"
     #include "wx/log.h"
 #endif // WX_PRECOMP
 
+#include "wx/intl.h"
 #include "wx/thread.h"
 #include "wx/tokenzr.h"
 #include "wx/module.h"
index 66a219459b10aaefb74652f86f4b5422e471cb56..711788c1e4c6bde0ba28b25971943406d28da07b 100644 (file)
@@ -1916,7 +1916,5 @@ void wxLocale::InitLanguagesDB()
 
 // --- --- --- generated code ends here --- --- ---
 
-
-
 #endif // wxUSE_INTL
 
index 8f7215b23518965df163d7bf46ea3d173e8f2cd4..604714fe7f83a1fb0cd042adef0711e9c980f71c 100644 (file)
@@ -337,7 +337,11 @@ void wxPopupWindowHandler::OnLeftDown(wxMouseEvent& event)
 void wxPopupFocusHandler::OnKillFocus(wxFocusEvent& event)
 {
     // when we lose focus we always disappear
-    m_popup->DismissAndNotify();
+
+    // But if m_popup was about to get the focus,
+    // don't disappear.
+    if (event.GetWindow() != m_popup)
+        m_popup->DismissAndNotify();
 }
 
 #endif // wxUSE_POPUPWIN
index 4de467688938ea84d59b2636fa2d9f1fb2c1a820..001b48549094bcdc7cf658fe9d21c17964a4efd8 100644 (file)
@@ -170,12 +170,30 @@ bool wxDialog::Create(wxWindow *parent,
         dlg = wxT("wxCaptionDialog");
     else
         dlg = wxT("wxNoCaptionDialog");
+
+#ifdef __WXMICROWIN__
+    extern const wxChar *wxFrameClassName;
+    
+    int msflags = WS_OVERLAPPED;
+    if (style & wxCAPTION)
+        msflags |= WS_CAPTION;
+    if (style & wxCLIP_CHILDREN)
+        msflags |= WS_CLIPCHILDREN;
+    if ((style & wxTHICK_FRAME) == 0)
+      msflags |= WS_BORDER;
+    MSWCreate(m_windowId, parent, wxFrameClassName, this, NULL,
+              x, y, width, height,
+              msflags,
+              NULL,
+              extendedStyle);
+
+#else
     MSWCreate(m_windowId, parent, NULL, this, NULL,
               x, y, width, height,
               0, // style is not used if we have dlg template
               dlg,
               extendedStyle);
-
+#endif
     HWND hwnd = (HWND)GetHWND();
 
     if ( !hwnd )
@@ -185,8 +203,10 @@ bool wxDialog::Create(wxWindow *parent,
         return FALSE;
     }
 
+#ifndef __WXMICROWIN__
     SubclassWin(GetHWND());
-
+#endif
+    
     SetWindowText(hwnd, title);
 
     return TRUE;
index b117cb09c1f3e0a2ba62a8807b0430b8bc09d74d..f9db6a472b51f1a2914aa9e8784bf4208478bc68 100644 (file)
@@ -1233,8 +1233,12 @@ int wxDisplayDepth()
 void wxDisplaySize(int *width, int *height)
 {
 #ifdef __WXMICROWIN__
-    // MICROWIN_TODO
-    *width = 0; * height = 0;
+    RECT rect;
+    HWND hWnd = GetDesktopWindow();
+    ::GetWindowRect(hWnd, & rect);
+
+    *width = rect.right - rect.left;
+    *height = rect.bottom - rect.top;
 #else
     ScreenHDC dc;
 
index 7c9db9eac1d72b883faa15fd49810d0b39c8e0c1..64ad5feeaa707bbea763d42cfea95a5ca9b9c885 100644 (file)
@@ -496,7 +496,19 @@ bool wxWindowMSW::Show(bool show)
 
     if ( show )
     {
+#ifdef __WXMICROWIN__
+       // It seems that MicroWindows brings the _parent_ of the
+       // window to the top, which can be the wrong one.
+       
+       /* activate (set focus to) specified window*/
+       ::SetFocus(hWnd);
+
+       /* raise top level parent to top of z order*/
+       ::SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
+               SWP_NOMOVE|SWP_NOSIZE);
+#else
         BringWindowToTop(hWnd);
+#endif
     }
 
     return TRUE;
@@ -508,8 +520,20 @@ void wxWindowMSW::Raise()
 #ifdef __WIN16__
     ::BringWindowToTop(GetHwnd());
 #else // Win32
+#ifdef __WXMICROWIN__
+       // It seems that MicroWindows brings the _parent_ of the
+       // window to the top, which can be the wrong one.
+       
+       /* activate (set focus to) specified window*/
+       ::SetFocus(GetHwnd());
+
+       /* raise top level parent to top of z order*/
+       ::SetWindowPos(GetHwnd(), HWND_TOP, 0, 0, 0, 0,
+               SWP_NOMOVE|SWP_NOSIZE);
+#else
     ::SetForegroundWindow(GetHwnd());
 #endif
+#endif
 }
 
 // Lower the window to the bottom of the Z order
@@ -921,6 +945,9 @@ void wxWindowMSW::SubclassWin(WXHWND hWnd)
     wxAssociateWinWithHandle(hwnd, this);
 
     m_oldWndProc = (WXFARPROC) GetWindowLong(hwnd, GWL_WNDPROC);
+
+    wxASSERT( (WXFARPROC) m_oldWndProc != (WXFARPROC) wxWndProc );
+    
     SetWindowLong(hwnd, GWL_WNDPROC, (LONG) wxWndProc);
 }
 
@@ -2656,9 +2683,9 @@ bool wxWindowMSW::MSWCreate(int id,
 
     wxWndHook = this;
 
+#ifndef __WXMICROWIN__
     if ( dialog_template )
     {
-#ifndef __WXMICROWIN__
         // for the dialogs without wxDIALOG_NO_PARENT style, use the top level
         // app window as parent - this avoids creating modal dialogs without
         // parent
@@ -2730,11 +2757,11 @@ bool wxWindowMSW::MSWCreate(int id,
         {
             wxLogLastError(wxT("MoveWindow"));
         }
-#endif
-       // __WXMICROWIN__
 
     }
     else // creating a normal window, not a dialog
+#endif
+       // __WXMICROWIN__
     {
         int controlId = 0;
         if ( style & WS_CHILD )
index 546f714ef4149cacf2431c615529f7983e09edca..92a7ae405e760658f99998f8d0f7c82e9575ac57 100644 (file)
@@ -75,21 +75,13 @@ void wxFrame::OnSize(wxSizeEvent& event)
 {
 #if wxUSE_MENUS
     PositionMenuBar();
-<<<<<<< framuniv.cpp
-#endif
-=======
-#endif // wxUSE_WAVE
+#endif // wxUSE_MENUS
 
->>>>>>> 1.4
     event.Skip();
 }
 
-<<<<<<< framuniv.cpp
-#if wxUSE_MENUS
-=======
 #if wxUSE_MENUS
 
->>>>>>> 1.4
 void wxFrame::PositionMenuBar()
 {
     if ( m_frameMenuBar )
@@ -100,14 +92,8 @@ void wxFrame::PositionMenuBar()
                                 GetClientSize().x, -1);
     }
 }
-<<<<<<< framuniv.cpp
-#endif // wxUSE_MENUS
-
-=======
-
 #endif // wxUSE_MENUS
 
->>>>>>> 1.4
 wxPoint wxFrame::GetClientAreaOrigin() const
 {
     wxPoint pt = wxFrameNative::GetClientAreaOrigin();
index ed3bd429ff1d8e2025258db6ce3b5f1bcf7b9f48..001380d7f25dbf2da7c1b67add78670968f6418a 100644 (file)
@@ -1963,7 +1963,7 @@ bool wxMenuBar::ProcessMouseEvent(const wxPoint& pt)
 
     // show the menu if we know that we should, even if we hadn't been showing
     // it before (this may happen if the previous menu was disabled)
-    if ( m_shouldShowMenu )
+    if ( m_shouldShowMenu && !m_menuShown)
     {
         // open the new menu if the old one we closed had been opened
         PopupCurrentMenu(FALSE /* don't select first item - as Windows does */);
index 68178a25e31f1ae59142ed5324a89098b6a66dfd..596bc217a36a2e2d9cdf2420b28a08e812d7fd56 100644 (file)
@@ -2410,7 +2410,6 @@ void wxWin32Renderer::DrawSliderTicks(wxDC& dc,
     DrawLine(dc, x2, y1, x2, y2, orient == wxVERTICAL);
 }
 
-#if wxUSE_MENUS
 // ----------------------------------------------------------------------------
 // menu and menubar
 // ----------------------------------------------------------------------------
@@ -2445,7 +2444,7 @@ private:
                 GetMenuGeometry(wxWindow *, const wxMenu&) const;
 };
 
-#endif // wxUSE_WAVE
+#endif // wxUSE_MENUS
 
 // FIXME: all constants are hardcoded but shouldn't be
 static const wxCoord MENU_LEFT_MARGIN = 9;
@@ -2680,9 +2679,6 @@ wxMenuGeometryInfo *wxWin32Renderer::GetMenuGeometry(wxWindow *win,
 
     return gi;
 }
-<<<<<<< win32.cpp
-#endif
-=======
 
 #else // !wxUSE_MENUS
 
@@ -2725,7 +2721,6 @@ wxWin32Renderer::GetMenuGeometry(wxWindow *WXUNUSED(win),
 
 #endif // wxUSE_MENUS/!wxUSE_MENUS
 
->>>>>>> 1.5
 // ----------------------------------------------------------------------------
 // combobox
 // ----------------------------------------------------------------------------