]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/win32.cpp
fixed pasting of Unicode strings
[wxWidgets.git] / src / univ / themes / win32.cpp
index 8629507e498732ceab7fe9545194772a080e7633..cb69172cc561571ace5c4818344d6a7c4c234f36 100644 (file)
@@ -38,6 +38,7 @@
     #include "wx/scrolbar.h"
     #include "wx/slider.h"
     #include "wx/textctrl.h"
+    #include "wx/listbox.h"
     #include "wx/toolbar.h"
 
     #ifdef __WXMSW__
@@ -1333,18 +1334,29 @@ wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const
     if ( !win->ShouldInheritColours() )
     {
         wxTextCtrl *text = wxDynamicCast(win, wxTextCtrl);
-        if ( text )
+#if wxUSE_LISTBOX
+        wxListBox* listBox = wxDynamicCast(win, wxListBox);
+#endif        
+        if ( text
+#if wxUSE_LISTBOX
+         || listBox
+#endif         
+          )
         {
-            if ( !text->IsEnabled() ) // not IsEditable()
+            if ( !win->IsEnabled() ) // not IsEditable()
                 col = Get(CONTROL);
-            //else: execute code below
-        }
-
-        if ( !col.Ok() )
-        {
-            // doesn't depend on the state
-            col = Get(WINDOW);
+            else
+            {
+                if ( !col.Ok() )
+                {
+                    // doesn't depend on the state
+                    col = Get(WINDOW);
+                }
+            }
         }
+        
+        if (!col.Ok())
+            col = Get(CONTROL); // Most controls should be this colour, not WINDOW
     }
     else
     {
@@ -3598,7 +3610,6 @@ void wxWin32Renderer::DrawFrameTitleBar(wxDC& dc,
             DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_HELP,
                             (specialButton == wxTOPLEVEL_BUTTON_HELP) ?
                             specialButtonFlags : 0);
-            x -= FRAME_BUTTON_WIDTH;
         }
     }
 }
@@ -4532,7 +4543,9 @@ private:
    
     wxWin32FrameInputHandler *m_inputHnd;
     wxTopLevelWindow         *m_wnd;
+#if wxUSE_ACCEL
     wxAcceleratorTable        m_oldAccelTable;
+#endif
 };
 
 wxWin32SystemMenuEvtHandler::wxWin32SystemMenuEvtHandler(
@@ -4549,6 +4562,7 @@ void wxWin32SystemMenuEvtHandler::Attach(wxInputConsumer *consumer)
     m_wnd = wxStaticCast(consumer->GetInputWindow(), wxTopLevelWindow);
     m_wnd->PushEventHandler(this);
     
+#if wxUSE_ACCEL
     // VS: This code relies on using generic implementation of 
     //     wxAcceleratorTable in wxUniv!
     wxAcceleratorTable table = *m_wnd->GetAcceleratorTable();
@@ -4556,13 +4570,16 @@ void wxWin32SystemMenuEvtHandler::Attach(wxInputConsumer *consumer)
     table.Add(wxAcceleratorEntry(wxACCEL_ALT, WXK_SPACE, wxID_SYSTEM_MENU));
     table.Add(wxAcceleratorEntry(wxACCEL_ALT, WXK_F4, wxID_CLOSE_FRAME));
     m_wnd->SetAcceleratorTable(table);
+#endif
 }
 
 void wxWin32SystemMenuEvtHandler::Detach()
 {
     if ( m_wnd )
     {
+#if wxUSE_ACCEL
         m_wnd->SetAcceleratorTable(m_oldAccelTable);
+#endif
         m_wnd->RemoveEventHandler(this); 
         m_wnd = NULL;
     }
@@ -4584,10 +4601,16 @@ void wxWin32SystemMenuEvtHandler::OnSystemMenu(wxCommandEvent &WXUNUSED(event))
     pt.x = -pt.x + border;
     pt.y = -pt.y + border + FRAME_TITLEBAR_HEIGHT;
 
+#if wxUSE_ACCEL
     wxAcceleratorTable table = *m_wnd->GetAcceleratorTable();
     m_wnd->SetAcceleratorTable(wxNullAcceleratorTable);
+#endif
+
     m_inputHnd->PopupSystemMenu(m_wnd, pt);
+
+#if wxUSE_ACCEL
     m_wnd->SetAcceleratorTable(table);
+#endif
 }
 
 void wxWin32SystemMenuEvtHandler::OnCloseFrame(wxCommandEvent &WXUNUSED(event))