projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't include windows.h unless neccessary
[wxWidgets.git]
/
src
/
msw
/
nativdlg.cpp
diff --git
a/src/msw/nativdlg.cpp
b/src/msw/nativdlg.cpp
index d85100a5ed54540c4a0e4bce6c53beae679de65a..85a7920b99224fcab297d6dc20333763ddd240b8 100644
(file)
--- a/
src/msw/nativdlg.cpp
+++ b/
src/msw/nativdlg.cpp
@@
-34,14
+34,15
@@
#include "wx/wx.h"
#endif
#include "wx/wx.h"
#endif
+#if defined(__WIN95__) && !defined(__TWIN32__)
#include "wx/spinbutt.h"
#include "wx/spinbutt.h"
+#endif
#include "wx/msw/private.h"
// ---------------------------------------------------------------------------
// global functions
// ---------------------------------------------------------------------------
#include "wx/msw/private.h"
// ---------------------------------------------------------------------------
// global functions
// ---------------------------------------------------------------------------
-extern wxWindow *wxWndHook;
extern LONG APIENTRY _EXPORT wxDlgProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
extern LONG APIENTRY _EXPORT wxDlgProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
@@
-52,12
+53,12
@@
extern LONG APIENTRY _EXPORT wxDlgProc(HWND hWnd, UINT message,
bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id)
{
m_windowId = id;
bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id)
{
m_windowId = id;
- wxWndHook = this;
+
+ wxWindowCreationHook hook(this);
m_hWnd = (WXHWND)::CreateDialog((HINSTANCE)wxGetInstance(),
MAKEINTRESOURCE(id),
parent ? (HWND)parent->GetHWND() : 0,
(DLGPROC) wxDlgProc);
m_hWnd = (WXHWND)::CreateDialog((HINSTANCE)wxGetInstance(),
MAKEINTRESOURCE(id),
parent ? (HWND)parent->GetHWND() : 0,
(DLGPROC) wxDlgProc);
- wxWndHook = NULL;
if ( !m_hWnd )
return FALSE;
if ( !m_hWnd )
return FALSE;
@@
-91,12
+92,11
@@
bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name)
{
SetName(name);
{
SetName(name);
- wxW
ndHook = this
;
+ wxW
indowCreationHook hook(this)
;
m_hWnd = (WXHWND)::CreateDialog((HINSTANCE) wxGetInstance(),
name.c_str(),
parent ? (HWND)parent->GetHWND() : 0,
(DLGPROC)wxDlgProc);
m_hWnd = (WXHWND)::CreateDialog((HINSTANCE) wxGetInstance(),
name.c_str(),
parent ? (HWND)parent->GetHWND() : 0,
(DLGPROC)wxDlgProc);
- wxWndHook = NULL;
if ( !m_hWnd )
return FALSE;
if ( !m_hWnd )
return FALSE;
@@
-171,7
+171,7
@@
wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
wxWindow* win = NULL;
wxWindow* win = NULL;
- if (str ==
"BUTTON"
)
+ if (str ==
wxT("BUTTON")
)
{
int style1 = (style & 0xFF);
if ((style1 == BS_3STATE) || (style1 == BS_AUTO3STATE) || (style1 == BS_AUTOCHECKBOX) ||
{
int style1 = (style & 0xFF);
if ((style1 == BS_3STATE) || (style1 == BS_AUTO3STATE) || (style1 == BS_AUTOCHECKBOX) ||
@@
-188,7
+188,7
@@
wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
{
// TODO: how to find the bitmap?
win = new wxBitmapButton;
{
// TODO: how to find the bitmap?
win = new wxBitmapButton;
- wxLogError(
"Have not yet implemented bitmap button as BS_BITMAP button."
);
+ wxLogError(
wxT("Have not yet implemented bitmap button as BS_BITMAP button.")
);
}
#endif
else if (style1 == BS_OWNERDRAW)
}
#endif
else if (style1 == BS_OWNERDRAW)
@@
-211,11
+211,11
@@
wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
}
else
{
}
else
{
- wxLogError(
_
T("Don't know what kind of button this is: id = %d"),
+ wxLogError(
wx
T("Don't know what kind of button this is: id = %d"),
id);
}
}
id);
}
}
- else if (str ==
"COMBOBOX"
)
+ else if (str ==
wxT("COMBOBOX")
)
{
win = new wxComboBox;
}
{
win = new wxComboBox;
}
@@
-225,30
+225,32
@@
wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
// for correct functioning.
// Could have wxWindow::AdoptAttributesFromHWND(WXHWND)
// to be overridden by each control class.
// for correct functioning.
// Could have wxWindow::AdoptAttributesFromHWND(WXHWND)
// to be overridden by each control class.
- else if (str ==
"EDIT"
)
+ else if (str ==
wxT("EDIT")
)
{
win = new wxTextCtrl;
}
{
win = new wxTextCtrl;
}
- else if (str ==
"LISTBOX"
)
+ else if (str ==
wxT("LISTBOX")
)
{
win = new wxListBox;
}
{
win = new wxListBox;
}
- else if (str ==
"SCROLLBAR"
)
+ else if (str ==
wxT("SCROLLBAR")
)
{
win = new wxScrollBar;
}
{
win = new wxScrollBar;
}
-#if defined(__WIN95__) && !defined(__TWIN32__)
- else if (str ==
"MSCTLS_UPDOWN32"
)
+#if defined(__WIN95__) && !defined(__TWIN32__)
&& wxUSE_SPINBTN
+ else if (str ==
wxT("MSCTLS_UPDOWN32")
)
{
win = new wxSpinButton;
}
#endif
{
win = new wxSpinButton;
}
#endif
- else if (str == "MSCTLS_TRACKBAR32")
+#if wxUSE_SLIDER
+ else if (str == wxT("MSCTLS_TRACKBAR32"))
{
// Need to ascertain if it's horiz or vert
win = new wxSlider;
}
{
// Need to ascertain if it's horiz or vert
win = new wxSlider;
}
- else if (str == "STATIC")
+#endif // wxUSE_SLIDER
+ else if (str == wxT("STATIC"))
{
int style1 = (style & 0xFF);
{
int style1 = (style & 0xFF);
@@
-260,13
+262,13
@@
wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
win = new wxStaticBitmap;
// Help! this doesn't correspond with the wxWin implementation.
win = new wxStaticBitmap;
// Help! this doesn't correspond with the wxWin implementation.
- wxLogError(
"Please make SS_BITMAP statics into owner-draw buttons."
);
+ wxLogError(
wxT("Please make SS_BITMAP statics into owner-draw buttons.")
);
}
#endif
}
else
{
}
#endif
}
else
{
- wxString msg(
"Don't know how to convert from Windows class "
);
+ wxString msg(
wxT("Don't know how to convert from Windows class ")
);
msg += str;
wxLogError(msg);
}
msg += str;
wxLogError(msg);
}
@@
-280,11
+282,9
@@
wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
win->SubclassWin(hWnd);
win->AdoptAttributesFromHWND();
win->SetupColours();
win->SubclassWin(hWnd);
win->AdoptAttributesFromHWND();
win->SetupColours();
-
- return win;
}
}
- else
-
return NULL
;
+
+
return win
;
}
// Make sure the window style (etc.) reflects the HWND style (roughly)
}
// Make sure the window style (etc.) reflects the HWND style (roughly)