Various Dialog Editor-related mods; Dlg Ed. getting usable now under MSW.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-08-10 13:48:12 +00:00
parent 983162bd54
commit 9c331ded69
18 changed files with 219 additions and 170 deletions

View File

@@ -1790,8 +1790,6 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
{ "wxLB_SINGLE", wxLB_SINGLE },
{ "wxLB_MULTIPLE", wxLB_MULTIPLE },
{ "wxLB_EXTENDED", wxLB_EXTENDED },
{ "wxNEEDED_SB", wxNEEDED_SB },
{ "wxALWAYS_SB", wxALWAYS_SB },
{ "wxLB_NEEDED_SB", wxLB_NEEDED_SB },
{ "wxLB_ALWAYS_SB", wxLB_ALWAYS_SB },
{ "wxLB_SORT", wxLB_SORT },
@@ -1918,8 +1916,6 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
{ "wxDEFAULT_DIALOG_STYLE", wxDEFAULT_DIALOG_STYLE},
{ "wxBORDER", wxBORDER},
{ "wxRETAINED", wxRETAINED},
{ "wxEDITABLE", wxEDITABLE},
{ "wxREADONLY", wxREADONLY},
{ "wxNATIVE_IMPL", 0},
{ "wxEXTENDED_IMPL", 0},
{ "wxBACKINGSTORE", wxBACKINGSTORE},

View File

@@ -82,9 +82,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
// Subclass again for purposes of dialog editing mode
SubclassWin((WXHWND)wx_button);
// TODO? If in future we have a facility for having a label as well
// as a bitmap, set the font.
// SetFont(parent->GetFont()) ;
SetFont(* parent->GetFont()) ;
SetSize(x, y, width, height);
ShowWindow(wx_button, SW_SHOW);

View File

@@ -245,8 +245,8 @@ void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
}
// If non-default width...
if (width >= 0)
control_width = (float)width;
if (w1 >= 0)
control_width = (float)w1;
control_height = (float)h1;

View File

@@ -74,9 +74,12 @@ void wxControl::SetLabel(const wxString& label)
wxString wxControl::GetLabel(void) const
{
wxBuffer[0] = 0;
if (GetHWND())
GetWindowText((HWND)GetHWND(), wxBuffer, 1000);
wxBuffer[0] = 0;
if (GetHWND())
{
int len = GetWindowText((HWND)GetHWND(), wxBuffer, 256);
wxBuffer[len] = 0;
}
return wxString(wxBuffer);
}

View File

@@ -50,6 +50,7 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id,
if (parent) parent->AddChild(this);
m_rangeMax = range;
m_gaugePos = 0;
SetBackgroundColour(parent->GetDefaultBackgroundColour()) ;
SetForegroundColour(parent->GetDefaultForegroundColour()) ;

View File

@@ -85,6 +85,7 @@ bool wxGaugeMSW::Create(wxWindow *parent, wxWindowID id,
if (parent) parent->AddChild(this);
m_rangeMax = range;
m_gaugePos = 0;
SetBackgroundColour(parent->GetDefaultBackgroundColour()) ;
SetForegroundColour(parent->GetDefaultForegroundColour()) ;

View File

@@ -154,6 +154,10 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
SubclassWin(GetHWND());
SetWindowText((HWND) m_hWnd, "");
SetFont(* parent->GetFont());
if ( m_windowStyle & wxSL_LABELS )
{
// Finally, create max value static item
@@ -163,7 +167,6 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);
SetFont(parent->GetFont());
if (GetFont())
{
@@ -418,6 +421,11 @@ void wxSlider95::SetSize(int x, int y, int width, int height, int sizeFlags)
else
{
// No labels
// If we're prepared to use the existing size, then...
if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
{
GetSize(&w1, &h1);
}
if ( w1 < 0 )
w1 = 200;
if ( h1 < 0 )
@@ -479,6 +487,11 @@ void wxSlider95::SetSize(int x, int y, int width, int height, int sizeFlags)
else
{
// No labels
// If we're prepared to use the existing size, then...
if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
{
GetSize(&w1, &h1);
}
if ( w1 < 0 )
w1 = 20;
if ( h1 < 0 )

View File

@@ -77,6 +77,9 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
// Subclass again for purposes of dialog editing mode
SubclassWin((WXHWND) static_item);
SetFont(* GetParent()->GetFont());
SetSize(x, y, width, height);
return TRUE;
}

View File

@@ -213,20 +213,6 @@ void wxStaticBox::OnEraseBackground(wxEraseEvent& event)
long wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
// TODO: somehow, this has to accept mouse clicks in user interface edit mode,
// but not otherwise. Only there is no longer a UI edit mode...
// It worked before because the message could be processed if not in UI
// edit mode. We have to find some way of distinguishing this.
// Maybe this class can have an AcceptMouseEvents(bool) function; a sort of
// kludge... or, we can search for an active event table entry that will
// intercept mouse events, and if one exists (that isn't the default),
// skip the code below. Too time consuming though.
// Perhaps it's ok to do the default thing *anyway* because the title or edge
// of the window may still be active!
// if (nMsg == WM_NCHITTEST)
// return Default();
if (nMsg == WM_NCHITTEST)
{
int xPos = LOWORD(lParam); // horizontal position of cursor