Get/SetTitle only for wxTopLevelWindow (wxMotif part).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-11-03 20:58:02 +00:00
parent 7996ff8038
commit 34097680c0
4 changed files with 81 additions and 79 deletions

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: window.h // Name: wx/motif/window.h
// Purpose: wxWindow class // Purpose: wxWindow class
// Author: Julian Smart // Author: Julian Smart
// Modified by: // Modified by:
@@ -27,11 +27,11 @@ public:
wxWindow() { Init(); } wxWindow() { Init(); }
wxWindow(wxWindow *parent, wxWindow(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0, long style = 0,
const wxString& name = wxPanelNameStr) const wxString& name = wxPanelNameStr)
{ {
Init(); Init();
Create(parent, id, pos, size, style, name); Create(parent, id, pos, size, style, name);
@@ -40,15 +40,15 @@ public:
virtual ~wxWindow(); virtual ~wxWindow();
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0, long style = 0,
const wxString& name = wxPanelNameStr); const wxString& name = wxPanelNameStr);
// implement base class pure virtuals // implement base class pure virtuals
virtual void SetTitle( const wxString& title); virtual void SetLabel(const wxString& label);
virtual wxString GetTitle() const; virtual wxString GetLabel() const;
virtual void Raise(); virtual void Raise();
virtual void Lower(); virtual void Lower();
@@ -325,5 +325,4 @@ protected:
static int ms_count; static int ms_count;
}; };
#endif #endif // _WX_WINDOW_H_
// _WX_WINDOW_H_

View File

@@ -154,7 +154,9 @@ public:
// return true if the frame is in fullscreen mode // return true if the frame is in fullscreen mode
virtual bool IsFullScreen() const = 0; virtual bool IsFullScreen() const = 0;
#ifdef __WXMSW__ #if !defined(__WXMSW__) && \
!defined(__WXMOTIF__)
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow // FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
// to wxTopLevelWindow so initially enabled in wxMSW only to observe results // to wxTopLevelWindow so initially enabled in wxMSW only to observe results
// and continue on other platforms // and continue on other platforms

View File

@@ -168,7 +168,9 @@ public:
// window attributes // window attributes
// ----------------- // -----------------
#ifndef __WXMSW__ #if !defined(__WXMSW__) && \
!defined(__WXMOTIF__)
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow // FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
// to wxTopLevelWindow so initially enabled in wxMSW only to observe results // to wxTopLevelWindow so initially enabled in wxMSW only to observe results
// and continue on other platforms // and continue on other platforms

View File

@@ -632,17 +632,17 @@ void wxWindow::Lower()
XLowerWindow(XtDisplay(wTop), window); XLowerWindow(XtDisplay(wTop), window);
} }
void wxWindow::SetTitle(const wxString& title) void wxWindow::SetLabel(const wxString& label)
{ {
XtVaSetValues((Widget)GetMainWidget(), XmNtitle, title.c_str(), NULL); XtVaSetValues((Widget)GetMainWidget(), XmNtitle, label.c_str(), NULL);
} }
wxString wxWindow::GetTitle() const wxString wxWindow::GetLabel() const
{ {
char *title; char *label;
XtVaGetValues((Widget)GetMainWidget(), XmNtitle, &title, NULL); XtVaGetValues((Widget)GetMainWidget(), XmNtitle, &label, NULL);
return wxString(title); return wxString(label);
} }
void wxWindow::DoCaptureMouse() void wxWindow::DoCaptureMouse()
@@ -852,7 +852,7 @@ void wxWindow::SetScrollbar(int orient, int pos, int thumbVisible,
// Adjusting scrollbars can resize the canvas accidentally // Adjusting scrollbars can resize the canvas accidentally
if (newW != oldW || newH != oldH) if (newW != oldW || newH != oldH)
SetSize(-1, -1, oldW, oldH); SetSize(wxDefaultCoord, wxDefaultCoord, oldW, oldH);
} }
// Does a physical scroll // Does a physical scroll
@@ -1065,7 +1065,7 @@ void wxWindow::DoSetToolTip(wxToolTip * WXUNUSED(tooltip))
bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
{ {
if ( x == -1 && y == -1 ) if ( x == wxDefaultCoord && y == wxDefaultCoord )
{ {
wxPoint mouse = ScreenToClient(wxGetMousePosition()); wxPoint mouse = ScreenToClient(wxGetMousePosition());
x = mouse.x; y = mouse.y; x = mouse.x; y = mouse.y;
@@ -1262,7 +1262,7 @@ void wxWindow::DoSetSizeIntr(int x, int y, int width, int height,
y = oldY; y = oldY;
} }
wxSize size(-1, -1); wxSize size(wxDefaultSize);
if ( width <= 0 ) if ( width <= 0 )
{ {
if ( ( sizeFlags & wxSIZE_AUTO_WIDTH ) && !fromCtor ) if ( ( sizeFlags & wxSIZE_AUTO_WIDTH ) && !fromCtor )
@@ -2546,4 +2546,3 @@ wxPoint wxGetMousePosition()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
int wxNoOptimize::ms_count = 0; int wxNoOptimize::ms_count = 0;