Get/SetTitle only for wxTopLevelWindow (wxCocoa part).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
// Author: David Elliott
|
// Author: David Elliott
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 2003/03/16
|
// Created: 2003/03/16
|
||||||
// RCS-ID: $Id:
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 2003 David Elliott
|
// Copyright: (c) 2003 David Elliott
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -59,7 +59,6 @@ public:
|
|||||||
virtual void SetValue(bool);
|
virtual void SetValue(bool);
|
||||||
virtual bool GetValue() const;
|
virtual bool GetValue() const;
|
||||||
virtual void SetLabel(const wxString& label);
|
virtual void SetLabel(const wxString& label);
|
||||||
virtual wxString GetLabel() const { return GetTitle(); }
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DoSet3StateValue(wxCheckBoxState state);
|
virtual void DoSet3StateValue(wxCheckBoxState state);
|
||||||
virtual wxCheckBoxState DoGet3StateValue() const;
|
virtual wxCheckBoxState DoGet3StateValue() const;
|
||||||
|
@@ -103,6 +103,8 @@ public:
|
|||||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
virtual void DoGetSize(int *width, int *height) const;
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
virtual void DoGetPosition(int *x, int *y) const;
|
virtual void DoGetPosition(int *x, int *y) const;
|
||||||
|
virtual void SetTitle( const wxString& title);
|
||||||
|
virtual wxString GetTitle() const;
|
||||||
|
|
||||||
|
|
||||||
// Things I may/may not do
|
// Things I may/may not do
|
||||||
@@ -111,7 +113,6 @@ public:
|
|||||||
// virtual void Clear() ;
|
// virtual void Clear() ;
|
||||||
// virtual void Raise();
|
// virtual void Raise();
|
||||||
// virtual void Lower();
|
// virtual void Lower();
|
||||||
// virtual void SetTitle( const wxString& title);
|
|
||||||
protected:
|
protected:
|
||||||
// is the frame currently iconized?
|
// is the frame currently iconized?
|
||||||
bool m_iconized;
|
bool m_iconized;
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
// Author: David Elliott
|
// Author: David Elliott
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 2002/12/26
|
// Created: 2002/12/26
|
||||||
// RCS-ID: $Id:
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 2002 David Elliott
|
// Copyright: (c) 2002 David Elliott
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -142,10 +142,13 @@ public:
|
|||||||
// Warp the pointer the given position
|
// Warp the pointer the given position
|
||||||
virtual void WarpPointer(int x_pos, int y_pos) ;
|
virtual void WarpPointer(int x_pos, int y_pos) ;
|
||||||
// Send the window a refresh event
|
// Send the window a refresh event
|
||||||
virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL);
|
virtual void Refresh(bool eraseBack = true, const wxRect *rect = NULL);
|
||||||
// Set/get the window's font
|
// Set/get the window's font
|
||||||
virtual bool SetFont(const wxFont& f);
|
virtual bool SetFont(const wxFont& f);
|
||||||
// inline virtual wxFont& GetFont() const;
|
// inline virtual wxFont& GetFont() const;
|
||||||
|
virtual void SetLabel(const wxString& label) { SetTitle(label); }
|
||||||
|
virtual wxString GetLabel() const { return GetTitle(); }
|
||||||
|
// label handling
|
||||||
// Get character size
|
// Get character size
|
||||||
virtual int GetCharHeight() const;
|
virtual int GetCharHeight() const;
|
||||||
virtual int GetCharWidth() const;
|
virtual int GetCharWidth() const;
|
||||||
@@ -155,8 +158,8 @@ public:
|
|||||||
const wxFont *theFont = NULL) const;
|
const wxFont *theFont = NULL) const;
|
||||||
// Scroll stuff
|
// Scroll stuff
|
||||||
virtual void SetScrollbar(int orient, int pos, int thumbVisible,
|
virtual void SetScrollbar(int orient, int pos, int thumbVisible,
|
||||||
int range, bool refresh = TRUE);
|
int range, bool refresh = true);
|
||||||
virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE);
|
virtual void SetScrollPos(int orient, int pos, bool refresh = true);
|
||||||
virtual int GetScrollPos(int orient) const;
|
virtual int GetScrollPos(int orient) const;
|
||||||
virtual int GetScrollThumb(int orient) const;
|
virtual int GetScrollThumb(int orient) const;
|
||||||
virtual int GetScrollRange(int orient) const;
|
virtual int GetScrollRange(int orient) const;
|
||||||
|
@@ -159,6 +159,7 @@ public:
|
|||||||
defined(__WXMOTIF__) || \
|
defined(__WXMOTIF__) || \
|
||||||
defined(__WXPM__) || \
|
defined(__WXPM__) || \
|
||||||
defined(__WXMAC__) || \
|
defined(__WXMAC__) || \
|
||||||
|
defined(__WXCOCOA__) || \
|
||||||
defined(__WXGTK__)
|
defined(__WXGTK__)
|
||||||
|
|
||||||
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
|
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
|
||||||
|
@@ -173,6 +173,7 @@ public:
|
|||||||
!defined(__WXMOTIF__) && \
|
!defined(__WXMOTIF__) && \
|
||||||
!defined(__WXPM__) && \
|
!defined(__WXPM__) && \
|
||||||
!defined(__WXMAC__) && \
|
!defined(__WXMAC__) && \
|
||||||
|
!defined(__WXCOCOA__) && \
|
||||||
!defined(__WXGTK__)
|
!defined(__WXGTK__)
|
||||||
|
|
||||||
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
|
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: cocoa/toplevel.mm
|
// Name: src/cocoa/toplevel.mm
|
||||||
// Purpose: implements wxTopLevelWindow for Cocoa
|
// Purpose: implements wxTopLevelWindow for Cocoa
|
||||||
// Author: David Elliott
|
// Author: David Elliott
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -93,7 +93,7 @@ bool wxTopLevelWindowCocoa::Create(wxWindow *parent,
|
|||||||
wxTopLevelWindows.Append(this);
|
wxTopLevelWindows.Append(this);
|
||||||
|
|
||||||
if(!CreateBase(parent,winid,pos,size,style,wxDefaultValidator,name))
|
if(!CreateBase(parent,winid,pos,size,style,wxDefaultValidator,name))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if ( parent )
|
if ( parent )
|
||||||
parent->AddChild(this);
|
parent->AddChild(this);
|
||||||
@@ -143,7 +143,7 @@ bool wxTopLevelWindowCocoa::Create(wxWindow *parent,
|
|||||||
if(style & wxSTAY_ON_TOP)
|
if(style & wxSTAY_ON_TOP)
|
||||||
[m_cocoaNSWindow setLevel:NSFloatingWindowLevel];
|
[m_cocoaNSWindow setLevel:NSFloatingWindowLevel];
|
||||||
[m_cocoaNSWindow setTitle:wxNSStringWithWxString(title)];
|
[m_cocoaNSWindow setTitle:wxNSStringWithWxString(title)];
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTopLevelWindowCocoa::~wxTopLevelWindowCocoa()
|
wxTopLevelWindowCocoa::~wxTopLevelWindowCocoa()
|
||||||
@@ -211,7 +211,7 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
|
|||||||
{
|
{
|
||||||
DeactivatePendingWindow();
|
DeactivatePendingWindow();
|
||||||
wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this);
|
wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this);
|
||||||
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
|
wxActivateEvent event(wxEVT_ACTIVATE, true, GetId());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
@@ -219,7 +219,7 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
|
|||||||
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
|
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
|
||||||
{
|
{
|
||||||
wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this);
|
wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this);
|
||||||
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
|
wxActivateEvent event(wxEVT_ACTIVATE, false, GetId());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
@@ -273,7 +273,7 @@ void wxTopLevelWindowCocoa::Iconize(bool iconize)
|
|||||||
|
|
||||||
bool wxTopLevelWindowCocoa::IsIconized() const
|
bool wxTopLevelWindowCocoa::IsIconized() const
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowCocoa::Restore()
|
void wxTopLevelWindowCocoa::Restore()
|
||||||
@@ -330,14 +330,25 @@ void wxTopLevelWindowCocoa::OnCloseWindow(wxCloseEvent& event)
|
|||||||
// wxTopLevelWindowCocoa misc
|
// wxTopLevelWindowCocoa misc
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxTopLevelWindowCocoa::SetTitle( const wxString& WXUNUSED(title))
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxTopLevelWindowCocoa::GetTitle() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return wxEmptyString;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxTopLevelWindowCocoa::ShowFullScreen(bool show, long style)
|
bool wxTopLevelWindowCocoa::ShowFullScreen(bool show, long style)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTopLevelWindowCocoa::IsFullScreen() const
|
bool wxTopLevelWindowCocoa::IsFullScreen() const
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowCocoa::CocoaSetWxWindowSize(int width, int height)
|
void wxTopLevelWindowCocoa::CocoaSetWxWindowSize(int width, int height)
|
||||||
@@ -383,4 +394,3 @@ void wxTopLevelWindowCocoa::DoGetPosition(int *x, int *y) const
|
|||||||
*y=(int)cocoaRect.origin.y;
|
*y=(int)cocoaRect.origin.y;
|
||||||
wxLogTrace(wxTRACE_COCOA_TopLevelWindow_Size,wxT("wxTopLevelWindow=%p::DoGetPosition = (%d,%d)"),this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y);
|
wxLogTrace(wxTRACE_COCOA_TopLevelWindow_Size,wxT("wxTopLevelWindow=%p::DoGetPosition = (%d,%d)"),this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
// Author: David Elliott
|
// Author: David Elliott
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 2002/12/26
|
// Created: 2002/12/26
|
||||||
// RCS-ID: $Id:
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 2002 David Elliott
|
// Copyright: (c) 2002 David Elliott
|
||||||
// Licence: wxWidgets licence
|
// Licence: wxWidgets licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -308,8 +308,8 @@ void wxWindowCocoa::Init()
|
|||||||
m_cocoaNSView = NULL;
|
m_cocoaNSView = NULL;
|
||||||
m_cocoaHider = NULL;
|
m_cocoaHider = NULL;
|
||||||
m_wxCocoaScrollView = NULL;
|
m_wxCocoaScrollView = NULL;
|
||||||
m_isBeingDeleted = FALSE;
|
m_isBeingDeleted = false;
|
||||||
m_isInPaint = FALSE;
|
m_isInPaint = false;
|
||||||
m_shouldBeEnabled = true;
|
m_shouldBeEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,7 +335,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID winid,
|
|||||||
SetInitialFrameRect(pos,size);
|
SetInitialFrameRect(pos,size);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
@@ -439,7 +439,7 @@ bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect)
|
|||||||
wxLogDebug(wxT("Paint event recursion!"));
|
wxLogDebug(wxT("Paint event recursion!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_isInPaint = TRUE;
|
m_isInPaint = true;
|
||||||
|
|
||||||
// Set m_updateRegion
|
// Set m_updateRegion
|
||||||
const NSRect *rects = ▭ // The bounding box of the region
|
const NSRect *rects = ▭ // The bounding box of the region
|
||||||
@@ -459,7 +459,7 @@ bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect)
|
|||||||
wxPaintEvent event(m_windowId);
|
wxPaintEvent event(m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
bool ret = GetEventHandler()->ProcessEvent(event);
|
bool ret = GetEventHandler()->ProcessEvent(event);
|
||||||
m_isInPaint = FALSE;
|
m_isInPaint = false;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -679,7 +679,7 @@ void wxWindowCocoa::DoSetSize(int x, int y, int width, int height, int sizeFlags
|
|||||||
|
|
||||||
AdjustForParentClientOrigin(x,y,sizeFlags);
|
AdjustForParentClientOrigin(x,y,sizeFlags);
|
||||||
|
|
||||||
wxSize size(-1,-1);
|
wxSize size(wxDefaultSize);
|
||||||
|
|
||||||
if((width==-1)&&!(sizeFlags&wxSIZE_ALLOW_MINUS_ONE))
|
if((width==-1)&&!(sizeFlags&wxSIZE_ALLOW_MINUS_ONE))
|
||||||
{
|
{
|
||||||
@@ -849,7 +849,18 @@ void wxWindow::DoSetClientSize(int width, int height)
|
|||||||
|
|
||||||
void wxWindow::CocoaSetWxWindowSize(int width, int height)
|
void wxWindow::CocoaSetWxWindowSize(int width, int height)
|
||||||
{
|
{
|
||||||
wxWindowCocoa::DoSetSize(-1,-1,width,height,wxSIZE_USE_EXISTING);
|
wxWindowCocoa::DoSetSize(wxDefaultCoord,wxDefaultCoord,width,height,wxSIZE_USE_EXISTING);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxWindow::SetLabel(const wxString& WXUNUSED(label))
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxWindow::GetLabel() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return wxEmptyString;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxWindow::GetCharHeight() const
|
int wxWindow::GetCharHeight() const
|
||||||
@@ -933,7 +944,7 @@ void wxWindow::DoSetVirtualSize( int x, int y )
|
|||||||
bool wxWindow::SetFont(const wxFont& font)
|
bool wxWindow::SetFont(const wxFont& font)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CocoaRaiseWindowCompareFunction(id first, id second, void *target)
|
static int CocoaRaiseWindowCompareFunction(id first, id second, void *target)
|
||||||
@@ -979,7 +990,7 @@ void wxWindow::Lower()
|
|||||||
|
|
||||||
bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
|
bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the window with the focus
|
// Get the window with the focus
|
||||||
@@ -1034,4 +1045,3 @@ wxWindow* wxFindWindowAtPointer(wxPoint& pt)
|
|||||||
pt = wxGetMousePosition();
|
pt = wxGetMousePosition();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user