// Author: David Elliott
// Modified by:
// Created: 2003/03/16
-// RCS-ID: $Id:
+// RCS-ID: $Id$
// Copyright: (c) 2003 David Elliott
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_COCOA_CHECKBOX_H__
virtual void SetValue(bool);
virtual bool GetValue() const;
virtual void SetLabel(const wxString& label);
- virtual wxString GetLabel() const { return GetTitle(); }
protected:
virtual void DoSet3StateValue(wxCheckBoxState state);
virtual wxCheckBoxState DoGet3StateValue() const;
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoGetSize(int *width, int *height) 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
// virtual void Clear() ;
// virtual void Raise();
// virtual void Lower();
-// virtual void SetTitle( const wxString& title);
protected:
// is the frame currently iconized?
bool m_iconized;
// Author: David Elliott
// Modified by:
// Created: 2002/12/26
-// RCS-ID: $Id:
+// RCS-ID: $Id$
// Copyright: (c) 2002 David Elliott
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_COCOA_WINDOW_H__
// Warp the pointer the given position
virtual void WarpPointer(int x_pos, int y_pos) ;
// 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
virtual bool SetFont(const wxFont& f);
// inline virtual wxFont& GetFont() const;
+ virtual void SetLabel(const wxString& label) { SetTitle(label); }
+ virtual wxString GetLabel() const { return GetTitle(); }
+ // label handling
// Get character size
virtual int GetCharHeight() const;
virtual int GetCharWidth() const;
const wxFont *theFont = NULL) const;
// Scroll stuff
virtual void SetScrollbar(int orient, int pos, int thumbVisible,
- int range, bool refresh = TRUE);
- virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE);
+ int range, bool refresh = true);
+ virtual void SetScrollPos(int orient, int pos, bool refresh = true);
virtual int GetScrollPos(int orient) const;
virtual int GetScrollThumb(int orient) const;
virtual int GetScrollRange(int orient) const;
defined(__WXMOTIF__) || \
defined(__WXPM__) || \
defined(__WXMAC__) || \
+ defined(__WXCOCOA__) || \
defined(__WXGTK__)
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
!defined(__WXMOTIF__) && \
!defined(__WXPM__) && \
!defined(__WXMAC__) && \
+ !defined(__WXCOCOA__) && \
!defined(__WXGTK__)
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
///////////////////////////////////////////////////////////////////////////////
-// Name: cocoa/toplevel.mm
+// Name: src/cocoa/toplevel.mm
// Purpose: implements wxTopLevelWindow for Cocoa
-// Author: David Elliott
+// Author: David Elliott
// Modified by:
// Created: 2002/11/27
// RCS-ID: $Id$
wxTopLevelWindows.Append(this);
if(!CreateBase(parent,winid,pos,size,style,wxDefaultValidator,name))
- return FALSE;
+ return false;
if ( parent )
parent->AddChild(this);
// Create frame and check and handle default position and size
int realx,
realy;
-
+
// WX has no set default position - the carbon port caps the low
// end at 20, 50. Here we do the same, except instead of setting
// it to 20 and 50, we set it to 100 and 100 if the values are too low
realx = 100;
else
realx = pos.x;
-
+
if (pos.y < 50)
realy = 100;
else
// NOTE: y-origin needs to be flipped.
NSRect cocoaRect = [NSWindow
- contentRectForFrameRect:NSMakeRect(realx,realy,realw,realh)
+ contentRectForFrameRect:NSMakeRect(realx,realy,realw,realh)
styleMask:cocoaStyle];
m_cocoaNSWindow = NULL;
if(style & wxSTAY_ON_TOP)
[m_cocoaNSWindow setLevel:NSFloatingWindowLevel];
[m_cocoaNSWindow setTitle:wxNSStringWithWxString(title)];
- return TRUE;
+ return true;
}
wxTopLevelWindowCocoa::~wxTopLevelWindowCocoa()
{
DeactivatePendingWindow();
wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this);
- wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
+ wxActivateEvent event(wxEVT_ACTIVATE, true, GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
{
wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this);
- wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
+ wxActivateEvent event(wxEVT_ACTIVATE, false, GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
bool wxTopLevelWindowCocoa::IsMaximized() const
{
- return false ;
+ return false ;
}
void wxTopLevelWindowCocoa::Iconize(bool iconize)
bool wxTopLevelWindowCocoa::IsIconized() const
{
- return FALSE;
+ return false;
}
void wxTopLevelWindowCocoa::Restore()
// wxTopLevelWindowCocoa misc
// ----------------------------------------------------------------------------
+void wxTopLevelWindowCocoa::SetTitle( const wxString& WXUNUSED(title))
+{
+ // TODO
+}
+
+wxString wxTopLevelWindowCocoa::GetTitle() const
+{
+ // TODO
+ return wxEmptyString;
+}
+
bool wxTopLevelWindowCocoa::ShowFullScreen(bool show, long style)
{
- return FALSE;
+ return false;
}
bool wxTopLevelWindowCocoa::IsFullScreen() const
{
- return FALSE;
+ return false;
}
void wxTopLevelWindowCocoa::CocoaSetWxWindowSize(int width, int height)
*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);
}
-
// Author: David Elliott
// Modified by:
// Created: 2002/12/26
-// RCS-ID: $Id:
+// RCS-ID: $Id$
// Copyright: (c) 2002 David Elliott
-// Licence: wxWidgets licence
+// Licence: wxWidgets licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
m_cocoaNSView = NULL;
m_cocoaHider = NULL;
m_wxCocoaScrollView = NULL;
- m_isBeingDeleted = FALSE;
- m_isInPaint = FALSE;
+ m_isBeingDeleted = false;
+ m_isInPaint = false;
m_shouldBeEnabled = true;
}
SetInitialFrameRect(pos,size);
}
- return TRUE;
+ return true;
}
// Destructor
wxLogDebug(wxT("Paint event recursion!"));
return false;
}
- m_isInPaint = TRUE;
+ m_isInPaint = true;
// Set m_updateRegion
const NSRect *rects = ▭ // The bounding box of the region
wxPaintEvent event(m_windowId);
event.SetEventObject(this);
bool ret = GetEventHandler()->ProcessEvent(event);
- m_isInPaint = FALSE;
+ m_isInPaint = false;
return ret;
}
{
if(!m_cursor.GetNSCursor())
return false;
-
- [GetNSView() addCursorRect: [GetNSView() visibleRect] cursor: m_cursor.GetNSCursor()];
-
+
+ [GetNSView() addCursorRect: [GetNSView() visibleRect] cursor: m_cursor.GetNSCursor()];
+
return true;
}
AdjustForParentClientOrigin(x,y,sizeFlags);
- wxSize size(-1,-1);
+ wxSize size(wxDefaultSize);
if((width==-1)&&!(sizeFlags&wxSIZE_ALLOW_MINUS_ONE))
{
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
bool wxWindow::SetFont(const wxFont& font)
{
// TODO
- return TRUE;
+ return true;
}
static int CocoaRaiseWindowCompareFunction(id first, id second, void *target)
bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
{
- return FALSE;
+ return false;
}
// Get the window with the focus
pt = wxGetMousePosition();
return NULL;
}
-