// prevent virtual function hiding
virtual void SetLabel(const wxString& label)
- { wxWindowBase::SetLabel(label); }
+ { wxWindow::SetLabel(label); }
#endif // WXWIN_COMPATIBILITY_2_6
protected:
virtual ~wxTopLevelWindowMSW();
// implement base class pure virtuals
+ virtual void SetTitle( const wxString& title);
+ virtual wxString GetTitle() const;
virtual void Maximize(bool maximize = true);
virtual bool IsMaximized() const;
virtual void Iconize(bool iconize = true);
};
#endif // _WX_MSW_TOPLEVEL_H_
-
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/window.h
-// Purpose: wxWindow class
+// Purpose: wxWindowMSW class
// Author: Julian Smart
// Modified by: Vadim Zeitlin on 13.05.99: complete refont of message handling,
// elimination of Default(), ...
const wxString& name = wxPanelNameStr);
// implement base class pure virtuals
- virtual void SetTitle( const wxString& title);
- virtual wxString GetTitle() const;
+ virtual void SetLabel(const wxString& label);
+ virtual wxString GetLabel() const;
virtual void Raise();
virtual void Lower();
extern wxWinHashTable *wxWinHandleHash;
-#endif
- // _WX_WINDOW_H_
+#endif // _WX_WINDOW_H_
// return true if the frame is in fullscreen mode
virtual bool IsFullScreen() const = 0;
- /*
- for now we already have them in wxWindow, but this is wrong: these
- methods really only make sense for wxTopLevelWindow!
+#ifdef __WXMSW__
+ // FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
+ // to wxTopLevelWindow so initially enabled in wxMSW only to observe results
+ // and continue on other platforms
+ // the title (or label, see below) of the window: the text which the
+ // window shows
virtual void SetTitle(const wxString& title) = 0;
virtual wxString GetTitle() const = 0;
- */
+#endif
// Set the shape of the window to the given region.
// Returns true if the platform supports this feature (and the
// window attributes
// -----------------
- // NB: in future versions of wxWidgets Set/GetTitle() will only work
- // with the top level windows (such as dialogs and frames) and
- // Set/GetLabel() only with the other ones (i.e. all controls).
+#ifndef __WXMSW__
+ // FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
+ // to wxTopLevelWindow so initially enabled in wxMSW only to observe results
+ // and continue on other platforms
- // the title (or label, see below) of the window: the text which the
- // window shows
virtual void SetTitle( const wxString& WXUNUSED(title) ) {}
virtual wxString GetTitle() const { return wxEmptyString; }
- // label is just the same as the title (but for, e.g., buttons it
- // makes more sense to speak about labels)
+ // label is just the same as the title (but for, e.g., buttons it
+ // makes more sense to speak about labels)
virtual void SetLabel(const wxString& label) { SetTitle(label); }
virtual wxString GetLabel() const { return GetTitle(); }
+#else
+ // label is just the same as the title (but for, e.g., buttons it
+ // makes more sense to speak about labels)
+ virtual void SetLabel(const wxString& label) = 0;
+ virtual wxString GetLabel() const = 0;
+#endif
// the window name is used for ressource setting in X, it is not the
// same as the window title/label
#endif // wxUSE_ACCESSIBILITY
-#endif
- // _WX_WINDOW_H_BASE_
-
+#endif // _WX_WINDOW_H_BASE_
void wxView::OnChangeFilename()
{
- if (GetFrame() && GetDocument())
- {
- wxString title;
+ // GetFrame can return wxWindow rather than wxTopLevelWindow due to
+ // generic MDI implementation so use SetLabel rather than SetTitle.
+ // It should cause SetTitle() for top level windows.
+ wxWindow *win = GetFrame();
+ if (!win) return;
- GetDocument()->GetPrintableName(title);
+ wxDocument *doc = GetDocument();
+ if (!doc) return;
- GetFrame()->SetTitle(title);
- }
+ wxString name;
+ doc->GetPrintableName(name);
+ win->SetLabel(name);
}
void wxView::SetDocument(wxDocument *doc)
#endif // wxUSE_STD_IOSTREAM/!wxUSE_STD_IOSTREAM
#endif // wxUSE_DOC_VIEW_ARCHITECTURE
-
/////////////////////////////////////////////////////////////////////////////
-// Name: msw/radiobox.cpp
+// Name: src/msw/radiobox.cpp
// Purpose: wxRadioBox implementation
// Author: Julian Smart
// Modified by:
// and also wide enough for its label
int widthLabel;
- GetTextExtent(GetTitle(), &widthLabel, NULL);
+ GetTextExtent(GetLabel(), &widthLabel, NULL);
widthLabel += RADIO_SIZE; // FIXME this is bogus too
if ( widthLabel > width )
width = widthLabel;
}
#endif // wxUSE_RADIOBOX
-
///////////////////////////////////////////////////////////////////////////////
-// Name: msw/toplevel.cpp
+// Name: src/msw/toplevel.cpp
// Purpose: implements wxTopLevelWindow for MSW
// Author: Vadim Zeitlin
// Modified by:
if ( style & wxMAXIMIZE_BOX )
msflags |= WS_MAXIMIZEBOX;
-#ifndef __WXWINCE__
+#ifndef __WXWINCE__
if ( style & wxSYSTEM_MENU )
msflags |= WS_SYSMENU;
#endif
}
SubclassWin(m_hWnd);
-
+
#ifdef __SMARTPHONE__
// Work around title non-display glitch
Show(false);
-#endif
+#endif
return true;
#endif // __WXMICROWIN__/!__WXMICROWIN__
// wxTopLevelWindowMSW misc
// ----------------------------------------------------------------------------
+void wxTopLevelWindowMSW::SetTitle( const wxString& title)
+{
+ SetLabel(title);
+}
+
+wxString wxTopLevelWindowMSW::GetTitle() const
+{
+ return GetLabel();
+}
+
void wxTopLevelWindowMSW::SetIcon(const wxIcon& icon)
{
SetIcons( wxIconBundle( icon ) );
return ms_hwnd;
}
-
-
/////////////////////////////////////////////////////////////////////////////
-// Name: src/msw/windows.cpp
-// Purpose: wxWindow
+// Name: src/msw/window.cpp
+// Purpose: wxWindowMSW
// Author: Julian Smart
// Modified by: VZ on 13.05.99: no more Default(), MSWOnXXX() reorganisation
// Created: 04/01/98
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
-void wxWindowMSW::SetTitle( const wxString& title)
-{
- SetWindowText(GetHwnd(), title.c_str());
-}
-
-wxString wxWindowMSW::GetTitle() const
-{
- return wxGetWindowText(GetHWND());
-}
-
void wxWindowMSW::DoCaptureMouse()
{
HWND hWnd = GetHwnd();
return GetEventHandler()->ProcessEvent(event);
}
+// ---------------------------------------------------------------------------
+// labels
+// ---------------------------------------------------------------------------
+
+void wxWindowMSW::SetLabel( const wxString& label)
+{
+ SetWindowText(GetHwnd(), label.c_str());
+}
+
+wxString wxWindowMSW::GetLabel() const
+{
+ return wxGetWindowText(GetHWND());
+}
+
// ---------------------------------------------------------------------------
// miscellaneous
// ---------------------------------------------------------------------------