virtual void Exit();
- virtual bool Yield(bool onlyIfNeeded = FALSE);
+ virtual bool Yield(bool onlyIfNeeded = false);
virtual void WakeUpIdle(); // implemented in motif/evtloop.cpp
virtual bool OnInitGui();
// items may be checked
bool IsChecked(size_t uiIndex) const;
- void Check(size_t uiIndex, bool bCheck = TRUE);
+ void Check(size_t uiIndex, bool bCheck = true);
// override base class functions
virtual int DoAppend(const wxString& item);
void SetFocus();
// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeFont(bool keepOriginalSize = true);
virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour();
WXWidget GetTopWidget() const { return m_formWidget; }
// note that this function will call colour.SetPixel,
// and will do one of curCol = colour, curCol = wxWHITE, curCol = wxBLACK
// roundToWhite has an effect for monochrome display only
- // if roundToWhite == TRUE then the colour will be set to white unless
- // it is RGB 0x000000;if roundToWhite == FALSE the colour wull be set to
+ // if roundToWhite == true then the colour will be set to white unless
+ // it is RGB 0x000000;if roundToWhite == true the colour wull be set to
// black unless it id RGB 0xffffff
int CalculatePixel(wxColour& colour, wxColour& curCol,
bool roundToWhite) const;
virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
- int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
+ int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
DECLARE_CLASS(wxPrinterDC)
// Create a printer DC
- wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, int orientation = wxPORTRAIT);
+ wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = true, int orientation = wxPORTRAIT);
~wxPrinterDC();
};
}
bool Create(wxWindow *parent, wxWindowID id,
- const wxString& title, // bool modal = FALSE, // TODO make this a window style?
+ const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
virtual bool Destroy();
- virtual bool Show(bool show = TRUE);
+ virtual bool Show(bool show = true);
void SetTitle(const wxString& title);
virtual void EndModal(int retCode);
// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeFont(bool keepOriginalSize = true);
virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour();
inline WXWidget GetTopWidget() const { return m_mainWidget; }
void SetData( wxDataObject &data );
wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
- virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; };
+ virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return true; };
// implementation
#if 0
int family,
int style,
int weight,
- bool underlined = FALSE,
+ bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
int family,
int style,
int weight,
- bool underlined = FALSE,
+ bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
void Init();
// VZ: IMHO, we don't need it at all...
- bool RealizeResource() { return TRUE; }
+ bool RealizeResource() { return true; }
void Unshare();
private:
{
DECLARE_DYNAMIC_CLASS(wxGDIObject)
public:
- inline wxGDIObject() { m_visible = FALSE; };
+ inline wxGDIObject() { m_visible = false; };
inline ~wxGDIObject() {};
inline bool IsNull() const { return (m_refData == 0); }
virtual wxString GetString(int n) const;
// implementation of wxListBoxbase
- virtual void SetSelection(int n, bool select = TRUE);
+ virtual void SetSelection(int n, bool select = true);
virtual void DoInsertItems(const wxArrayString& items, int pos);
virtual void DoSetItems(const wxArrayString& items, void **clientData);
virtual void DoSetFirstItem(int n);
// MDI operations
virtual void Maximize();
virtual void Maximize(bool WXUNUSED(maximize)) { };
- inline void Minimize() { Iconize(TRUE); };
+ inline void Minimize() { Iconize(true); };
virtual void Iconize(bool iconize);
virtual void Restore();
virtual void Activate();
virtual bool IsIconized() const ;
- virtual bool IsTopLevel() const { return FALSE; }
+ virtual bool IsTopLevel() const { return false; }
- // Is the frame maximized? Returns TRUE for
+ // Is the frame maximized? Returns true for
// wxMDIChildFrame due to the tabbed implementation.
virtual bool IsMaximized(void) const ;
WXWidget CreateMenu(wxMenuBar *menuBar, WXWidget parent, wxMenu *topMenu,
const wxString& title = wxEmptyString,
- bool isPulldown = FALSE);
+ bool isPulldown = false);
// For popups, need to destroy, then recreate menu for a different (or
// possibly same) window, since the parent may change.
void SetBackgroundColour(const wxColour& colour);
void SetForegroundColour(const wxColour& colour);
void SetFont(const wxFont& colour);
- void ChangeFont(bool keepOriginalSize = FALSE);
+ void ChangeFont(bool keepOriginalSize = false);
WXWidget GetHandle() const { return m_menuWidget; }
virtual bool SetBackgroundColour(const wxColour& colour);
virtual bool SetForegroundColour(const wxColour& colour);
virtual bool SetFont(const wxFont& colour);
- void ChangeFont(bool keepOriginalSize = FALSE);
+ void ChangeFont(bool keepOriginalSize = false);
public:
// common part of all ctors
// accessors (some more are inherited from wxOwnerDrawn or are below)
virtual void SetText(const wxString& label);
- virtual void Enable(bool enable = TRUE);
- virtual void Check(bool check = TRUE);
+ virtual void Enable(bool enable = true);
+ virtual void Check(bool check = true);
// included SetBitmap and GetBitmap as copied from the GTK include file
// I'm not sure if this works but it silences the linker in the
// menu sample.
wxPrinter(wxPrintData *data = NULL);
~wxPrinter();
- virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE);
+ virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true);
virtual bool PrintDialog(wxWindow *parent);
virtual bool Setup(wxWindow *parent);
};
wxColour& foregroundColour);
extern void wxDoChangeBackgroundColour(WXWidget widget,
wxColour& backgroundColour,
- bool changeArmColour = FALSE);
+ bool changeArmColour = false);
extern void wxDoChangeFont(WXWidget widget, wxFont& font);
#define wxNO_COLORS 0x00
void SetString(int item, const wxString& label) ;
wxString GetString(int item) const;
- virtual bool Enable(bool enable = TRUE);
+ virtual bool Enable(bool enable = true);
void Enable(int item, bool enable);
void Show(int item, bool show) ;
- virtual bool Show(bool show = TRUE) ;
+ virtual bool Show(bool show = true) ;
virtual wxString GetStringSelection() const;
virtual bool SetStringSelection(const wxString& s);
void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeFont(bool keepOriginalSize = true);
virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour();
const wxWidgetArray& GetRadioButtons() const { return m_radioButtons; }
virtual void SetThumbPosition(int viewStart);
virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
- bool refresh = TRUE);
+ bool refresh = true);
void Command(wxCommandEvent& event);
// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeFont(bool keepOriginalSize = true);
virtual void ChangeBackgroundColour();
protected:
// Implementation
virtual void Command(wxCommandEvent& event)
{ (void)ProcessCommand(event); };
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeFont(bool keepOriginalSize = true);
virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour();
public:
virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event))
{
- return FALSE;
+ return false;
}
wxBitmap GetBitmap() const { return m_messageBitmap; }
virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event))
{
- return FALSE;
+ return false;
}
virtual WXWidget GetLabelWidget() const { return m_labelWidget; }
// operations
virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event))
{
- return FALSE;
+ return false;
}
virtual void SetLabel(const wxString& label);
{ Init(); }
~wxTimer();
- virtual bool Start(int milliseconds = -1, bool oneShot = FALSE);
+ virtual bool Start(int milliseconds = -1, bool oneShot = false);
virtual void Stop();
virtual bool IsRunning() const { return m_id != 0; }
virtual bool ShowFullScreen( bool show, long style = wxFULLSCREEN_ALL );
virtual bool IsFullScreen() const;
- virtual void Maximize(bool maximize = TRUE);
+ virtual void Maximize(bool maximize = true);
virtual void Restore();
- virtual void Iconize(bool iconize = TRUE);
+ virtual void Iconize(bool iconize = true);
virtual bool IsMaximized() const;
virtual bool IsIconized() const;
long style,
const wxString& name )
{
- return FALSE;
+ return false;
}
virtual void DoDestroy() { }
virtual void Raise();
virtual void Lower();
- virtual bool Show( bool show = TRUE );
- virtual bool Enable( bool enable = TRUE );
+ virtual bool Show( bool show = true );
+ virtual bool Enable( bool enable = true );
virtual void SetFocus();
virtual void WarpPointer(int x, int y);
- virtual void Refresh( bool eraseBackground = TRUE,
+ virtual void Refresh( bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL );
virtual bool SetBackgroundColour( const wxColour &colour );
const;
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;
// Change properties
// Change to the current font (often overridden)
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeFont(bool keepOriginalSize = true);
// Change background and foreground colour using current background colour
// setting (Motif generates foreground based on background)
// wxWidgets wxKeyEvent form. Find a widget for the window. Now find a
// wxWindow for the widget. If there isn't one, go up the widget hierarchy
// trying to find one. Once one is found, call ProcessAccelerator for the
- // window. If it returns TRUE (processed the event), skip the X event,
+ // window. If it returns true (processed the event), skip the X event,
// otherwise carry on up the wxWidgets window hierarchy calling
- // ProcessAccelerator. If all return FALSE, process the X event as normal.
+ // ProcessAccelerator. If all return false, process the X event as normal.
// Eventually we can implement OnCharHook the same way, but concentrate on
// accelerators for now. ProcessAccelerator must look at the current
// accelerator table, and try to find what menu id or window (beneath it)
void UnmanageAndDestroy(WXWidget widget);
// map or unmap an X widget (passing NULL is ok),
- // returns TRUE if widget was mapped/unmapped
+ // returns true if widget was mapped/unmapped
bool MapOrUnmap(WXWidget widget, bool map);
// scrolling stuff
bool wxApp::OnInitGui()
{
if( !wxAppBase::OnInitGui() )
- return FALSE;
+ return false;
XtToolkitInitialize() ;
wxTheApp->m_appContext = (WXAppContext) XtCreateApplicationContext();
wxAddIdleCallback();
- return TRUE;
+ return true;
}
WXColormap wxApp::GetMainColormap(WXDisplay* display)
bool wxApp::Yield(bool onlyIfNeeded)
{
- static bool s_inYield = FALSE;
+ static bool s_inYield = false;
if ( s_inYield )
{
wxFAIL_MSG( wxT("wxYield called recursively" ) );
}
- return FALSE;
+ return false;
}
- s_inYield = TRUE;
+ s_inYield = true;
while (wxTheApp && wxTheApp->Pending())
wxTheApp->Dispatch();
- s_inYield = FALSE;
+ s_inYield = false;
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
m_mainWidget = (WXWidget) buttonWidget;
- ChangeFont(FALSE);
+ ChangeFont(false);
ChangeBackgroundColour ();
AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
pos.x, pos.y, best.x, best.y);
- return TRUE;
+ return true;
}
wxBitmapButton::~wxBitmapButton()
void wxBitmapButton::ChangeBackgroundColour()
{
- wxDoChangeBackgroundColour(m_mainWidget, m_backgroundColour, TRUE);
+ wxDoChangeBackgroundColour(m_mainWidget, m_backgroundColour, true);
// Must reset the bitmaps since the colours have changed.
DoSetBitmap();
{
if( !wxControl::CreateControl( parent, id, pos, size, style, validator,
name ) )
- return FALSE;
+ return false;
wxString label1(wxStripMenuCodes(label));
wxXmString text( label1 );
XmNvalueChangedCallback, (XtCallbackProc)wxCheckBoxCallback,
(XtPointer)this );
- XmToggleButtonSetState ((Widget) m_mainWidget, FALSE, TRUE);
+ XmToggleButtonSetState ((Widget) m_mainWidget, False, True);
AttachWidget( parent, m_mainWidget, (WXWidget)NULL,
pos.x, pos.y, size.x, size.y );
ChangeBackgroundColour();
- return TRUE;
+ return true;
}
void wxCheckBox::SetValue(bool val)
copy.Clear();
for(size_t i = 0; i < orig.GetCount(); ++i )
- copy.Add( Prefix(FALSE) + orig[i] );
+ copy.Add( Prefix(false) + orig[i] );
}
// def ctor: use Create() to really create the control
else if( HasClientUntypedData() )
event.SetClientData( GetClientData(n) );
event.SetInt(n);
- event.SetExtraLong(TRUE);
+ event.SetExtraLong(true);
event.SetEventObject(this);
event.SetString( GetString( n ) );
int wxCheckListBox::DoAppend(const wxString& item)
{
- return wxListBox::DoAppend( Prefix(FALSE) + item );
+ return wxListBox::DoAppend( Prefix(false) + item );
}
int wxCheckListBox::FindString(const wxString& s) const
{
- int n1 = wxListBox::FindString(Prefix(FALSE) + s);
- int n2 = wxListBox::FindString(Prefix(TRUE) + s);
+ int n1 = wxListBox::FindString(Prefix(false) + s);
+ int n2 = wxListBox::FindString(Prefix(true) + s);
int min = wxMin(n1, n2), max = wxMax(n1, n2);
// why this works:
col.m_red = xcol.red & 0xff;
col.m_green = xcol.green & 0xff;
col.m_blue = xcol.blue & 0xff;
- col.m_isInit = TRUE;
+ col.m_isInit = true;
col.m_pixel = -1;
}
event.SetClientObject( item->GetClientObject(cbs->index - 1) );
else if ( item->HasClientUntypedData() )
event.SetClientData( item->GetClientData(cbs->index - 1) );
- event.SetExtraLong(TRUE);
+ event.SetExtraLong(true);
event.SetEventObject(item);
item->ProcessCommand (event);
break;
wxCommandEvent event (wxEVT_COMMAND_TEXT_UPDATED, item->GetId());
event.SetInt(-1);
event.SetString( item->GetValue() );
- event.SetExtraLong(TRUE);
+ event.SetExtraLong(true);
event.SetEventObject(item);
item->ProcessCommand (event);
break;
}
}
-// TRUE if we're between the above two calls
+// true if we're between the above two calls
bool wxIsBusy()
{
return (wxBusyCursorCount > 0);
m_type = wxDF_PRIVATE;
wxString tmp( id );
m_format = XInternAtom( wxGlobalDisplay(),
- tmp.mbc_str(), FALSE );
+ tmp.mbc_str(), False );
}
void wxDataFormat::PrepareFormats()
{
if (!g_textAtom)
- g_textAtom = XInternAtom( wxGlobalDisplay(), "STRING", FALSE );
+ g_textAtom = XInternAtom( wxGlobalDisplay(), "STRING", False );
if (!g_bitmapAtom)
- g_bitmapAtom = XInternAtom( wxGlobalDisplay(), "PIXMAP", FALSE );
+ g_bitmapAtom = XInternAtom( wxGlobalDisplay(), "PIXMAP", False );
if (!g_fileAtom)
- g_fileAtom = XInternAtom( wxGlobalDisplay(), "file:ALL", FALSE );
+ g_fileAtom = XInternAtom( wxGlobalDisplay(), "file:ALL", False );
}
// ----------------------------------------------------------------------------
wxDC::wxDC()
{
- m_ok = FALSE;
+ m_ok = false;
m_mm_to_pix_x = 1.0;
m_mm_to_pix_y = 1.0;
m_backgroundMode = wxTRANSPARENT;
- m_isInteractive = FALSE;
+ m_isInteractive = false;
}
void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y)
wxCHECK_RET( Ok(), "invalid dc" );
wxCHECK_RET( icon.Ok(), "invalid icon" );
- DoDrawBitmap(icon, x, y, TRUE);
+ DoDrawBitmap(icon, x, y, true);
}
void wxDC::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask )
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
- m_clipping = TRUE;
+ m_clipping = true;
m_clipX1 = x;
m_clipY1 = y;
m_clipX2 = x + width;
}
if (mode != wxMM_TEXT)
{
- m_needComputeScaleX = TRUE;
- m_needComputeScaleY = TRUE;
+ m_needComputeScaleX = true;
+ m_needComputeScaleY = true;
}
}
if (m_brush.Ok() && m_brush.GetStyle () != wxTRANSPARENT)
{
- m_autoSetting = TRUE; // must be reset
+ m_autoSetting = true; // must be reset
SetBrush (m_brush);
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd, wd, hd, start, end);
source->LogicalToDeviceXRel(width),
source->LogicalToDeviceYRel(height),
XLOG2DEV_2 (xdest), YLOG2DEV_2 (ydest),
- TRUE, &cache);
+ true, &cache);
if ( useMask && source->IsKindOf(CLASSINFO(wxMemoryDC)) )
{
source->LogicalToDeviceXRel(width),
source->LogicalToDeviceYRel(height),
XLOG2DEV (xdest), YLOG2DEV (ydest),
- FALSE, &cache);
+ False, &cache);
if ( useMask )
{
destcm = (Colormap) wxTheApp->GetMainColormap((WXDisplay*) dest_display);
cache_pos = 0;
- all_cache = FALSE;
+ all_cache = False;
for (i = 0; i < w; i++)
for (j = 0; j < h; j++) {
if (++cache_pos >= CACHE_SIZE) {
cache_pos = 0;
- all_cache = TRUE;
+ all_cache = true;
}
install:
}
else
{
- m_ok = FALSE;
+ m_ok = false;
m_pixmap = (WXPixmap) 0;
};
};
&gcvalues);
m_backgroundPixel = (int) gcvalues.background;
- m_ok = TRUE;
+ m_ok = true;
}
wxScreenDC::~wxScreenDC()
bool wxScreenDC::StartDrawingOnTop(wxRect* rect)
{
if (sm_overlayWindow)
- return FALSE;
+ return false;
Display *dpy = (Display*) wxGetDisplay();
Pixmap screenPixmap = RootWindow(dpy, DefaultScreen(dpy));
if (sm_overlayWindow)
{
XMapWindow(dpy, (Window) sm_overlayWindow);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
bool wxScreenDC::EndDrawingOnTop()
{
XDestroyWindow((Display*) wxGetDisplay(), (Window) sm_overlayWindow);
sm_overlayWindow = 0;
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
wxDialog::wxDialog()
{
- m_modalShowing = FALSE;
+ m_modalShowing = false;
m_eventLoop = NULL;
m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
}
if( !wxTopLevelWindow::Create( parent, id, title, pos, size, style,
name ) )
- return FALSE;
+ return false;
- m_modalShowing = FALSE;
+ m_modalShowing = false;
m_eventLoop = NULL;
m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
SetTitle( title );
m_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
- ChangeFont(FALSE);
+ ChangeFont(false);
// Can't remember what this was about... but I think it's necessary.
if (wxUSE_INVISIBLE_RESIZE)
// is managed, so we manage without mapping to the screen.
// To show, we map the shell (actually it's parent).
if (!wxUSE_INVISIBLE_RESIZE)
- XtVaSetValues(shell, XmNmappedWhenManaged, FALSE, NULL);
+ XtVaSetValues(shell, XmNmappedWhenManaged, False, NULL);
if (!wxUSE_INVISIBLE_RESIZE)
{
XtManageChild(dialogShell);
SetSize(pos.x, pos.y, size.x, size.y);
}
- XtAddEventHandler(dialogShell,ExposureMask,FALSE,
+ XtAddEventHandler(dialogShell,ExposureMask,False,
wxUniversalRepaintProc, (XtPointer) this);
ChangeBackgroundColour();
- return TRUE;
+ return true;
}
bool wxDialog::DoCreate( wxWindow* parent, wxWindowID id,
wxAddWindowToTable( (Widget)m_mainWidget, this );
- return TRUE;
+ return true;
}
void wxDialog::SetModal(bool flag)
wxDialog::~wxDialog()
{
- m_isBeingDeleted = TRUE;
+ m_isBeingDeleted = true;
delete m_eventLoop;
if (m_mainWidget)
{
- XtRemoveEventHandler((Widget) m_mainWidget, ExposureMask, FALSE,
+ XtRemoveEventHandler((Widget) m_mainWidget, ExposureMask, False,
wxUniversalRepaintProc, (XtPointer) this);
}
- m_modalShowing = FALSE;
+ m_modalShowing = false;
if (!wxUSE_INVISIBLE_RESIZE && m_mainWidget)
{
XtUnmapWidget((Widget) m_mainWidget);
XtUnmanageChild((Widget)m_mainWidget) ;
XFlush(XtDisplay((Widget)m_mainWidget));
- XSync(XtDisplay((Widget)m_mainWidget), FALSE);
+ XSync(XtDisplay((Widget)m_mainWidget), False);
}
- return TRUE;
+ return true;
}
// Shows a dialog modally, returning a return code
{
m_windowStyle |= wxDIALOG_MODAL;
- Show(TRUE);
+ Show(true);
// after the event loop ran, the widget might already have been destroyed
WXDisplay* display = (WXDisplay*)XtDisplay( (Widget)m_mainWidget );
return 0;
m_eventLoop = new wxEventLoop;
- m_modalShowing = TRUE;
- XtAddGrab((Widget) m_mainWidget, TRUE, FALSE);
+ m_modalShowing = true;
+ XtAddGrab((Widget) m_mainWidget, True, False);
m_eventLoop->Run();
// Strangely, we don't seem to need this now.
// XtRemoveGrab((Widget) m_mainWidget);
- Show(FALSE);
+ Show(false);
- m_modalShowing = FALSE;
+ m_modalShowing = false;
m_eventLoop->Exit();
}
else
{
SetReturnCode(wxID_OK);
- this->Show(FALSE);
+ this->Show(false);
}
}
}
else
{
SetReturnCode(wxID_CANCEL);
- this->Show(FALSE);
+ this->Show(false);
}
}
{
if (!wxPendingDelete.Member(this))
wxPendingDelete.Append(this);
- return TRUE;
+ return true;
}
void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
bool wxTextDropTarget::OnDrop( long x, long y, const void *data, size_t WXUNUSED(size) )
{
OnDropText( x, y, (const char*)data );
- return TRUE;
+ return true;
}
bool wxTextDropTarget::OnDropText( long x, long y, const char *psz )
{
wxLogDebug( "Got dropped text: %s.", psz );
wxLogDebug( "At x: %d, y: %d.", (int)x, (int)y );
- return TRUE;
+ return true;
}
size_t wxTextDropTarget::GetFormatCount() const
{
wxLogDebug( aszFiles[i] );
}
- return TRUE;
+ return true;
}
bool wxFileDropTarget::OnDrop(long x, long y, const void *data, size_t size )
for (i = 0; i < size; i++)
if (text[i] == 0) number++;
- if (number == 0) return TRUE;
+ if (number == 0) return true;
char **files = new char*[number];
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
{
#if 0
- g_blockEventsOnDrag = TRUE;
+ g_blockEventsOnDrag = true;
m_window = win;
m_widget = win->m_widget;
UnregisterWindow();
- g_blockEventsOnDrag = FALSE;
+ g_blockEventsOnDrag = false;
return m_retValue;
#endif
wxString wxFileDialog::m_fileSelectorAnswer = "";
-bool wxFileDialog::m_fileSelectorReturned = FALSE;
+bool wxFileDialog::m_fileSelectorReturned = false;
static void wxFileSelClose(Widget WXUNUSED(w),
void* WXUNUSED(client_data),
XmAnyCallbackStruct *WXUNUSED(call_data))
{
wxFileDialog::m_fileSelectorAnswer = "";
- wxFileDialog::m_fileSelectorReturned = TRUE;
+ wxFileDialog::m_fileSelectorReturned = true;
}
void wxFileSelCancel( Widget WXUNUSED(fs), XtPointer WXUNUSED(client_data),
XmFileSelectionBoxCallbackStruct *WXUNUSED(cbs) )
{
wxFileDialog::m_fileSelectorAnswer = "";
- wxFileDialog::m_fileSelectorReturned = TRUE;
+ wxFileDialog::m_fileSelectorReturned = true;
}
void wxFileSelOk(Widget WXUNUSED(fs), XtPointer WXUNUSED(client_data), XmFileSelectionBoxCallbackStruct *cbs)
char *filename = NULL;
if (!XmStringGetLtoR(cbs->value, XmSTRING_DEFAULT_CHARSET, &filename)) {
wxFileDialog::m_fileSelectorAnswer = "";
- wxFileDialog::m_fileSelectorReturned = TRUE;
+ wxFileDialog::m_fileSelectorReturned = true;
} else {
if (filename) {
wxFileDialog::m_fileSelectorAnswer = filename;
XtFree(filename);
}
- wxFileDialog::m_fileSelectorReturned = TRUE;
+ wxFileDialog::m_fileSelectorReturned = true;
}
}
// Change colour of the scrolled areas of the listboxes
Widget listParent = XtParent (widget);
#if 0
- wxDoChangeBackgroundColour((WXWidget) listParent, *wxWHITE, TRUE);
+ wxDoChangeBackgroundColour((WXWidget) listParent, *wxWHITE, true);
#endif
Widget hsb = (Widget) 0;
* function to change them (by default, taken from wxSystemSettings)
*/
wxColour backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
- wxDoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE);
- wxDoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE);
+ wxDoChangeBackgroundColour((WXWidget) hsb, backgroundColour, true);
+ wxDoChangeBackgroundColour((WXWidget) vsb, backgroundColour, true);
if (hsb)
XtVaSetValues (hsb,
XtManageChild(fileSel);
m_fileSelectorAnswer = "";
- m_fileSelectorReturned = FALSE;
+ m_fileSelectorReturned = false;
wxEndBusyCursor();
- XtAddGrab(XtParent(fileSel), TRUE, FALSE);
+ XtAddGrab(XtParent(fileSel), True, False);
XtAppContext context = (XtAppContext) wxTheApp->GetAppContext();
XEvent event;
while (!m_fileSelectorReturned)
int family = wxDEFAULT,
int style = wxDEFAULT,
int weight = wxDEFAULT,
- bool underlined = FALSE,
+ bool underlined = false,
const wxString& faceName = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
RealizeResource();
- return TRUE;
+ return true;
}
bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
if( !fontname )
{
*this = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT);
- return TRUE;
+ return true;
}
m_refData = new wxFontRefData();
}
//else: unknown encoding - may be give a warning here?
else
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
wxFont::~wxFont()
bool wxFont::GetUnderlined() const
{
- wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") );
+ wxCHECK_MSG( Ok(), false, wxT("invalid font") );
return M_FONTDATA->m_underlined;
}
void wxFrame::Init()
{
- m_iconized = FALSE;
+ m_iconized = false;
//// Motif-specific
m_frameShell = (WXWidget) NULL;
{
if( !wxTopLevelWindow::Create( parent, id, title, pos, size, style,
name ) )
- return FALSE;
+ return false;
m_backgroundColour =
wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
"Created frame (0x%p) with work area 0x%p and client "
"area 0x%p", m_mainWidget, m_workArea, m_clientArea);
- XtAddEventHandler((Widget) m_clientArea, ExposureMask,FALSE,
+ XtAddEventHandler((Widget) m_clientArea, ExposureMask,False,
wxUniversalRepaintProc, (XtPointer) this);
if (x > -1)
if (height > -1)
XtVaSetValues((Widget) m_frameShell, XmNheight, height, NULL);
- ChangeFont(FALSE);
+ ChangeFont(false);
ChangeBackgroundColour();
GetEventHandler()->ProcessEvent(sizeEvent);
- return TRUE;
+ return true;
}
bool wxFrame::DoCreate( wxWindow* parent, wxWindowID id,
XmNallowShellResize, True,
XmNdeleteResponse, XmDO_NOTHING,
XmNmappedWhenManaged, False,
- XmNiconic, (style & wxICONIZE) ? TRUE : FALSE,
+ XmNiconic, (style & wxICONIZE) ? True : False,
NULL);
m_frameShell = (WXWidget)frameShell;
wxModelessWindows.Append( this );
- return TRUE;
+ return true;
}
wxFrame::~wxFrame()
{
- m_isBeingDeleted = TRUE;
+ m_isBeingDeleted = true;
if (m_clientArea)
{
- XtRemoveEventHandler((Widget) m_clientArea, ExposureMask, FALSE,
+ XtRemoveEventHandler((Widget) m_clientArea, ExposureMask, False,
wxUniversalRepaintProc, (XtPointer) this);
}
if (GetMainWidget())
- Show(FALSE);
+ Show(false);
if (m_frameMenuBar)
{
PositionStatusBar();
#endif // wxUSE_STATUSBAR
- return TRUE;
+ return true;
}
WXWidget wxFrame::GetClientWidget() const
if( size.x != -1 ) best.x = size.x;
if( size.y != -1 ) best.y = size.y;
- ChangeFont(FALSE);
+ ChangeFont(false);
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, x, y,
best.x, best.y);
ChangeBackgroundColour();
- return TRUE;
+ return true;
}
wxSize wxGauge::DoGetBestSize() const
sizeof(XmGaugeRec), /* widget_size */
NULL, /* class_initialize */
NULL, /* class_part_initialize */
- FALSE, /* class_inited */
+ False, /* class_inited */
Initialize, /* initialize */
NULL, /* initialize_hook */
XtInheritRealize, /* realize */
resources, /* resources */
XtNumber(resources), /* num_resources */
NULLQUARK, /* xrm_class */
- TRUE, /* compress_motion */
- TRUE, /* compress_exposure */
- TRUE, /* compress_enterleave */
- FALSE, /* visible_interest */
+ True, /* compress_motion */
+ True, /* compress_exposure */
+ True, /* compress_enterleave */
+ False, /* visible_interest */
Destroy, /* destroy */
NULL, /* resize */
ExposeProc, /* expose */
return handler->LoadFile(this, filename, type,
desiredWidth, desiredHeight);
else
- return FALSE;
+ return false;
}
{
if( !wxControl::CreateControl( parent, id, pos, size, style,
validator, name ) )
- return FALSE;
+ return false;
m_noItems = n;
m_backgroundColour = * wxWHITE;
ChangeBackgroundColour();
- return TRUE;
+ return true;
}
bool wxListBox::Create(wxWindow *parent, wxWindowID id,
if ( clientData )
for (i = 0; i < items.GetCount(); ++i)
- m_clientDataDict.Set(i, (wxClientData*)clientData[i], FALSE);
+ m_clientDataDict.Set(i, (wxClientData*)clientData[i], false);
XmListAddItems (listBox, text, items.GetCount(), 0);
for (i = 0; i < items.GetCount(); i++)
void wxListBox::SetSelection(int N, bool select)
{
- m_inSetValue = TRUE;
+ m_inSetValue = true;
if (select)
{
#if 0
int i;
for (i = 0; i < n; i++)
XmListSelectPos ((Widget) m_mainWidget,
- selections[i] + 1, FALSE);
+ selections[i] + 1, False);
- XmListSelectPos ((Widget) m_mainWidget, N + 1, FALSE);
+ XmListSelectPos ((Widget) m_mainWidget, N + 1, False);
XtVaSetValues ((Widget) m_mainWidget,
XmNselectionPolicy, XmEXTENDED_SELECT,
}
else
#endif // 0
- XmListSelectPos ((Widget) m_mainWidget, N + 1, FALSE);
+ XmListSelectPos ((Widget) m_mainWidget, N + 1, False);
}
else
XmListDeselectPos ((Widget) m_mainWidget, N + 1);
- m_inSetValue = FALSE;
+ m_inSetValue = false;
}
bool wxListBox::IsSelected(int N) const
wxArrayInt theSelections;
int count = GetSelections (theSelections);
if (count == 0)
- return FALSE;
+ return false;
else
{
int j;
for (j = 0; j < count; j++)
if (theSelections[j] == N)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData)
{
- m_clientDataDict.Set(n, clientData, FALSE);
+ m_clientDataDict.Set(n, clientData, false);
}
wxClientData* wxListBox::DoGetItemClientObject(int n) const
void wxListBox::DoSetItemClientData(int N, void *Client_data)
{
- m_clientDataDict.Set(N, (wxClientData*)Client_data, FALSE);
+ m_clientDataDict.Set(N, (wxClientData*)Client_data, false);
}
// Return number of selections and an array of selected integers
else if ( item->HasClientUntypedData() )
event.SetClientData( item->GetClientData(n) );
event.SetInt(n);
- event.SetExtraLong(TRUE);
+ event.SetExtraLong(true);
event.SetEventObject(item);
event.SetString( item->GetString( n ) );
* function to change them (by default, taken from wxSystemSettings)
*/
wxColour backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
- wxDoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE);
- wxDoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE);
+ wxDoChangeBackgroundColour((WXWidget) hsb, backgroundColour, true);
+ wxDoChangeBackgroundColour((WXWidget) vsb, backgroundColour, true);
XtVaSetValues (hsb,
XmNtroughColor, backgroundColour.AllocColour(XtDisplay(hsb)),
NULL);
// MBN: why change parent's background? It looks really ugly.
- // wxDoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
+ // wxDoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, true);
}
void wxListBox::ChangeForegroundColour()
int w, h;
GetClientSize(& w, & h);
m_clientWindow->SetSize(0, 0, w, h);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
wxMDIParentFrame::~wxMDIParentFrame()
// Stops the same event being processed repeatedly
static wxEventType inEvent = wxEVT_NULL;
if (inEvent == event.GetEventType())
- return FALSE;
+ return false;
inEvent = event.GetEventType();
- bool res = FALSE;
+ bool res = false;
if (m_activeChild && event.IsKindOf(CLASSINFO(wxCommandEvent)))
{
res = m_activeChild->GetEventHandler()->ProcessEvent(event);
wxMDIChildFrame* oldActiveChild = parent->GetActiveChild();
if (oldActiveChild)
{
- wxActivateEvent event(wxEVT_ACTIVATE, FALSE, oldActiveChild->GetId());
+ wxActivateEvent event(wxEVT_ACTIVATE, false, oldActiveChild->GetId());
event.SetEventObject( oldActiveChild );
oldActiveChild->GetEventHandler()->ProcessEvent(event);
}
XmNresizePolicy, XmRESIZE_NONE,
NULL);
- XtAddEventHandler((Widget) m_mainWidget, ExposureMask,FALSE,
+ XtAddEventHandler((Widget) m_mainWidget, ExposureMask,False,
wxUniversalRepaintProc, (XtPointer) this);
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
SetTitle(title);
- clientWindow->AddPage(this, title, TRUE);
+ clientWindow->AddPage(this, title, true);
clientWindow->Refresh();
// Positions the toolbar and status bar -- but we don't have any.
// PreResize();
wxModelessWindows.Append(this);
- return TRUE;
+ return true;
}
wxMDIChildFrame::~wxMDIChildFrame()
{
if (m_mainWidget)
- XtRemoveEventHandler((Widget) m_mainWidget, ExposureMask,FALSE,
+ XtRemoveEventHandler((Widget) m_mainWidget, ExposureMask,False,
wxUniversalRepaintProc, (XtPointer) this);
if (GetMDIParentFrame())
if (oldActiveChild)
{
- wxActivateEvent event(wxEVT_ACTIVATE, FALSE, oldActiveChild->GetId());
+ wxActivateEvent event(wxEVT_ACTIVATE, false, oldActiveChild->GetId());
event.SetEventObject( oldActiveChild );
oldActiveChild->GetEventHandler()->ProcessEvent(event);
}
- wxActivateEvent event(wxEVT_ACTIVATE, TRUE, this->GetId());
+ wxActivateEvent event(wxEVT_ACTIVATE, true, this->GetId());
event.SetEventObject( this );
this->GetEventHandler()->ProcessEvent(event);
}
if (oldActiveChild == this)
{
- wxActivateEvent event(wxEVT_ACTIVATE, FALSE, oldActiveChild->GetId());
+ wxActivateEvent event(wxEVT_ACTIVATE, false, oldActiveChild->GetId());
event.SetEventObject( oldActiveChild );
oldActiveChild->GetEventHandler()->ProcessEvent(event);
}
bool wxMDIChildFrame::IsIconized() const
{
- return FALSE;
+ return false;
}
// Is it maximized? Always maximized under Motif, using the
// tabbed MDI implementation.
bool wxMDIChildFrame::IsMaximized(void) const
{
- return TRUE;
+ return true;
}
void wxMDIChildFrame::Restore()
{
wxFont font(10, wxSWISS, wxNORMAL, wxNORMAL);
SetFont(font);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
int wxMDIClientWindow::FindPage(const wxNotebookPage* page)
wxMDIChildFrame* oldChild = (wxMDIChildFrame*) GetPage(event.GetOldSelection());
if (oldChild)
{
- wxActivateEvent event(wxEVT_ACTIVATE, FALSE, oldChild->GetId());
+ wxActivateEvent event(wxEVT_ACTIVATE, false, oldChild->GetId());
event.SetEventObject( oldChild );
oldChild->GetEventHandler()->ProcessEvent(event);
}
wxMDIChildFrame* activeChild = (wxMDIChildFrame*) GetPage(event.GetSelection());
if (activeChild)
{
- wxActivateEvent event(wxEVT_ACTIVATE, TRUE, activeChild->GetId());
+ wxActivateEvent event(wxEVT_ACTIVATE, true, activeChild->GetId());
event.SetEventObject( activeChild );
activeChild->GetEventHandler()->ProcessEvent(event);
m_buttonWidget = (WXWidget) NULL;
m_menuId = 0;
m_topLevelMenu = (wxMenu*) NULL;
- m_ownedByMenuBar = FALSE;
+ m_ownedByMenuBar = false;
if ( !!m_title )
{
if (m_menuWidget)
{
if (m_menuParent)
- DestroyMenu(TRUE);
+ DestroyMenu(true);
else
- DestroyMenu(FALSE);
+ DestroyMenu(false);
}
// Not sure if this is right
wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
{
- item->DestroyItem(TRUE);
+ item->DestroyItem(true);
return wxMenuBase::DoRemove(item);
}
bool wxMenu::ProcessCommand(wxCommandEvent & event)
{
- bool processed = FALSE;
+ bool processed = false;
#if wxUSE_MENU_CALLBACK
// Try a callback
if (m_callback)
{
(void) (*(m_callback)) (*this, event);
- processed = TRUE;
+ processed = true;
}
#endif // wxUSE_MENU_CALLBACK
bool wxMenuBar::Append(wxMenu * menu, const wxString& title)
{
- wxCHECK_MSG( menu, FALSE, wxT("invalid menu") );
- wxCHECK_MSG( !menu->GetParent() && !menu->GetButtonWidget(), FALSE,
+ wxCHECK_MSG( menu, false, wxT("invalid menu") );
+ wxCHECK_MSG( !menu->GetParent() && !menu->GetButtonWidget(), false,
wxT("menu already appended") );
if ( m_menuBarFrame )
{
- WXWidget w = menu->CreateMenu(this, GetMainWidget(), menu, title, TRUE);
- wxCHECK_MSG( w, FALSE, wxT("failed to create menu") );
+ WXWidget w = menu->CreateMenu(this, GetMainWidget(), menu, title, true);
+ wxCHECK_MSG( w, false, wxT("failed to create menu") );
menu->SetButtonWidget(w);
}
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
{
if ( !wxMenuBarBase::Insert(pos, menu, title) )
- return FALSE;
+ return false;
wxFAIL_MSG(wxT("TODO"));
- return FALSE;
+ return false;
}
wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
return NULL;
if ( m_menuBarFrame )
- menu->DestroyMenu(TRUE);
+ menu->DestroyMenu(true);
menu->SetMenuBar(NULL);
XtManageChild((Widget) m_mainWidget);
*/
XtMapWidget((Widget) m_mainWidget);
- return TRUE;
+ return true;
}
Widget menuBarW = XmCreateMenuBar ((Widget) parent->GetMainWidget(), "MenuBar", NULL, 0);
{
wxMenu *menu = GetMenu(i);
wxString title(m_titles[i]);
- menu->SetButtonWidget(menu->CreateMenu (this, menuBarW, menu, title, TRUE));
+ menu->SetButtonWidget(menu->CreateMenu (this, menuBarW, menu, title, true));
if (strcmp (wxStripMenuCodes(title), "Help") == 0)
XtVaSetValues ((Widget) menuBarW, XmNmenuHelpWidget, (Widget) menu->GetButtonWidget(), NULL);
NULL);
Widget tearOff = XmGetTearOffControl(GetWidget(menu));
wxDoChangeForegroundColour((Widget) tearOff, m_foregroundColour);
- wxDoChangeBackgroundColour((Widget) tearOff, m_backgroundColour, TRUE);
+ wxDoChangeBackgroundColour((Widget) tearOff, m_backgroundColour, true);
#endif
}
}
XtManageChild ((Widget) menuBarW);
SetMenuBarFrame(parent);
- return TRUE;
+ return true;
}
// Destroy menubar, but keep data structures intact so we can recreate it.
if (!m_mainWidget)
{
SetMenuBarFrame((wxFrame*) NULL);
- return FALSE;
+ return false;
}
XtUnmanageChild ((Widget) m_mainWidget);
for (size_t i = 0; i < menuCount; i++)
{
wxMenu *menu = GetMenu(i);
- menu->DestroyMenu(TRUE);
+ menu->DestroyMenu(true);
}
XtDestroyWidget((Widget) m_mainWidget);
SetMenuBarFrame((wxFrame*) NULL);
- return TRUE;
+ return true;
}
// Since PopupMenu under Motif stills grab right mouse button events
}
}
- DestroyMenu(TRUE);
+ DestroyMenu(true);
}
// Mark as no longer popped up
if (m_menuWidget)
wxDoChangeBackgroundColour(m_menuWidget, (wxColour&) col);
if (m_buttonWidget)
- wxDoChangeBackgroundColour(m_buttonWidget, (wxColour&) col, TRUE);
+ wxDoChangeBackgroundColour(m_buttonWidget, (wxColour&) col, true);
for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
node;
if (item->GetButtonWidget())
{
// This crashes because it uses gadgets
- // wxDoChangeBackgroundColour(item->GetButtonWidget(), (wxColour&) col, TRUE);
+ // wxDoChangeBackgroundColour(item->GetButtonWidget(), (wxColour&) col, true);
}
if (item->GetSubMenu())
item->GetSubMenu()->SetBackgroundColour((wxColour&) col);
for (size_t i = 0; i < menuCount; i++)
m_menus.Item(i)->GetData()->SetBackgroundColour((wxColour&) col);
- return TRUE;
+ return true;
}
bool wxMenuBar::SetForegroundColour(const wxColour& col)
for (size_t i = 0; i < menuCount; i++)
m_menus.Item(i)->GetData()->SetForegroundColour((wxColour&) col);
- return TRUE;
+ return true;
}
void wxMenuBar::ChangeFont(bool WXUNUSED(keepOriginalSize))
for (size_t i = 0; i < menuCount; i++)
m_menus.Item(i)->GetData()->SetFont(font);
- return TRUE;
+ return true;
}
}
else if (m_subMenu)
{
- m_buttonWidget = m_subMenu->CreateMenu (menuBar, menu, topMenu, m_text, TRUE);
+ m_buttonWidget = m_subMenu->CreateMenu (menuBar, menu, topMenu, m_text, true);
m_subMenu->SetButtonWidget(m_buttonWidget);
XtAddCallback ((Widget) m_buttonWidget,
XmNcascadingCallback,
if (item->IsCheckable())
{
- Boolean isChecked = FALSE;
+ Boolean isChecked = false;
XtVaGetValues ((Widget) item->GetButtonWidget(),
XmNset, & isChecked,
NULL);
int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
{
if ( !m_refData )
- return FALSE;
+ return false;
// TODO
- return FALSE;
+ return false;
}
bool wxPalette::GetRGB(int index, unsigned char *WXUNUSED(red), unsigned char *WXUNUSED(green), unsigned char *WXUNUSED(blue)) const
(XtPointer) this);
}
- ChangeFont(FALSE);
+ ChangeFont(false);
SetSelection (0);
ChangeBackgroundColour();
- return TRUE;
+ return true;
}
bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
m_selectedButton = n;
- m_inSetValue = TRUE;
+ m_inSetValue = true;
- XmToggleButtonSetState ((Widget) m_radioButtons[n], TRUE, FALSE);
+ XmToggleButtonSetState ((Widget) m_radioButtons[n], True, False);
int i;
for (i = 0; i < m_noItems; i++)
if (i != n)
- XmToggleButtonSetState ((Widget) m_radioButtons[i], FALSE, FALSE);
+ XmToggleButtonSetState ((Widget) m_radioButtons[i], False, False);
- m_inSetValue = FALSE;
+ m_inSetValue = false;
}
// Get single selection, for single choice list items
bool wxRadioBox::Enable(bool enable)
{
if ( !wxControl::Enable(enable) )
- return FALSE;
+ return false;
int i;
for (i = 0; i < m_noItems; i++)
XtSetSensitive ((Widget) m_radioButtons[i], (Boolean) enable);
- return TRUE;
+ return true;
}
bool wxRadioBox::Show(bool show)
if (sel > -1)
{
SetSelection (sel);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
void wxRadioBox::Command (wxCommandEvent & event)
{
WXWidget radioButton = m_radioButtons[i];
- wxDoChangeBackgroundColour(radioButton, m_backgroundColour, TRUE);
+ wxDoChangeBackgroundColour(radioButton, m_backgroundColour, true);
XtVaSetValues ((Widget) radioButton,
XmNselectColor, selectPixel,
ChangeBackgroundColour();
- //copied from mac/radiobut.cpp (from here till "return TRUE;")
+ //copied from mac/radiobut.cpp (from here till "return true;")
m_cycle = this ;
if (HasFlag(wxRB_GROUP))
}
AddInCycle( chief ) ;
}
- return TRUE;
+ return true;
}
void wxRadioButton::SetValue(bool value)
if (GetValue() == value)
return;
- m_inSetValue = TRUE;
- XmToggleButtonSetState ((Widget) m_mainWidget, (Boolean) value, FALSE);
- m_inSetValue = FALSE;
+ m_inSetValue = true;
+ XmToggleButtonSetState ((Widget) m_mainWidget, (Boolean) value, False);
+ m_inSetValue = false;
ClearSelections();
}
//based on mac/radiobut.cpp
wxRadioButton* old = item->ClearSelections();
- item->SetValue(TRUE);
+ item->SetValue(true);
if ( old )
{
wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED,
old->GetId() );
event.SetEventObject(old);
- event.SetInt( FALSE );
+ event.SetInt( false );
old->ProcessCommand(event);
}
wxCommandEvent event2(wxEVT_COMMAND_RADIOBUTTON_SELECTED, item->GetId() );
event2.SetEventObject(item);
- event2.SetInt( TRUE );
+ event2.SetInt( true );
item->ProcessCommand(event2);
}
if ( cycle->GetValue() )
{
old = cycle;
- cycle->SetValue(FALSE);
+ cycle->SetValue(false);
}
cycle = cycle->NextInCycle();
}
{
case wxSYS_SYSTEM_FIXED_FONT:
{
- return wxFont(12, wxMODERN, wxNORMAL, wxNORMAL, FALSE);
+ return wxFont(12, wxMODERN, wxNORMAL, wxNORMAL, false);
break;
}
case wxSYS_DEVICE_DEFAULT_FONT:
case wxSYS_DEFAULT_GUI_FONT:
default:
{
- return wxFont(12, wxSWISS, wxNORMAL, wxNORMAL, FALSE);
+ return wxFont(12, wxSWISS, wxNORMAL, wxNORMAL, false);
break;
}
}
{
case wxSYS_CAN_ICONIZE_FRAME:
case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
DoSetBitmap();
- ChangeFont(FALSE);
+ ChangeFont(false);
wxSize actualSize(size);
// work around the cases where the bitmap is a wxNull(Icon/Bitmap)
AttachWidget (parent, m_mainWidget, NULL, pos.x, pos.y, size.x, size.y);
ChangeBackgroundColour();
- return TRUE;
+ return true;
}
wxStaticBox::~wxStaticBox()
ChangeBackgroundColour ();
- return TRUE;
+ return true;
}
void wxStaticText::SetLabel(const wxString& label)
void wxTextCtrl::WriteText(const wxString& text)
{
- long textPosition = GetInsertionPoint() + strlen (text);
+ long textPosition = GetInsertionPoint() + text.length();
XmTextInsert ((Widget) m_mainWidget, GetInsertionPoint(),
wxConstCast(text.c_str(), char));
XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
m_milli,
(XtTimerCallbackProc) wxTimerCallback,
(XtPointer) this);
- return TRUE;
+ return true;
}
void wxTimer::Stop()
{
if( !wxControl::CreateControl( parent, id, pos, size, style,
wxDefaultValidator, name ) )
- return FALSE;
+ return false;
m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
m_mainWidget = (WXWidget) toolbar;
- ChangeFont(FALSE);
+ ChangeFont(false);
wxPoint rPos = pos;
wxSize rSize = size;
ChangeBackgroundColour();
- return TRUE;
+ return true;
}
wxToolBar::~wxToolBar()
if ( m_tools.GetCount() == 0 )
{
// nothing to do
- return TRUE;
+ return true;
}
bool isVertical = GetWindowStyle() & wxTB_VERTICAL;
if( !tool->GetButtonWidget() )
{
wxDoChangeBackgroundColour((WXWidget) button,
- m_backgroundColour, TRUE);
+ m_backgroundColour, true);
tool->SetWidget(button);
}
isVertical ? buttonWidth + 2 * marginX : -1,
isVertical ? -1 : buttonHeight + 2*marginY );
- return TRUE;
+ return true;
}
wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x),
{
tool->Attach(this);
- return TRUE;
+ return true;
}
bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
}
}
- return TRUE;
+ return true;
}
void wxToolBar::DoEnableTool(wxToolBarToolBase *toolBase, bool enable)
wxToolBarTimer::help_popup = (Widget) 0;
// One shot
- wxTheToolBarTimer->Start(delayMilli, TRUE);
+ wxTheToolBarTimer->Start(delayMilli, true);
}
/************************************************************/
XtRemoveEventHandler( (Widget)GetClientWidget(),
ButtonPressMask | ButtonReleaseMask |
PointerMotionMask | KeyPressMask,
- FALSE,
+ False,
wxTLWEventHandler,
(XtPointer)this );
}
void wxTopLevelWindowMotif::Init()
{
- m_isShown = FALSE;
+ m_isShown = false;
}
bool wxTopLevelWindowMotif::Create( wxWindow *parent, wxWindowID id,
bool retval = DoCreate( parent, id, title, pos, size, style, name );
- if( !retval ) return FALSE;
+ if( !retval ) return false;
// Intercept CLOSE messages from the window manager
Widget shell = (Widget)GetShellWidget();
// no-decorations case.
if( ( m_windowStyle & wxCAPTION ) != wxCAPTION )
XtVaSetValues( shell,
- XmNoverrideRedirect, TRUE,
+ XmNoverrideRedirect, True,
NULL );
}
XtAddEventHandler( (Widget)GetClientWidget(),
ButtonPressMask | ButtonReleaseMask |
PointerMotionMask | KeyPressMask,
- FALSE,
+ False,
wxTLWEventHandler,
(XtPointer)this );
long style )
{
// TODO, see wxGTK
- return FALSE;
+ return false;
}
bool wxTopLevelWindowMotif::IsFullScreen() const
{
// TODO, see wxGTK
- return FALSE;
+ return false;
}
void wxTopLevelWindowMotif::Restore()
if( shell )
XtVaSetValues( shell,
- XmNiconic, FALSE,
+ XmNiconic, False,
NULL );
}
if( !shell ) return;
if( !iconize )
- Show( TRUE );
+ Show( true );
XtVaSetValues( shell,
XmNiconic, (Boolean)iconize,
Widget shell = GetShell( this );
if( !shell )
- return FALSE;
+ return false;
Boolean iconic;
XtVaGetValues( shell,
void wxTopLevelWindowMotif::Maximize( bool maximize )
{
- Show( TRUE );
+ Show( true );
if( maximize )
Restore();
bool wxTopLevelWindowMotif::IsMaximized() const
{
- return FALSE;
+ return false;
}
void wxTopLevelWindowMotif::DoSetSizeHints( int minW, int minH,
else
{
// An attempt to implement OnCharHook by calling OnCharHook first;
- // if this returns TRUE, set continueToDispatch to False
+ // if this returns true, set continueToDispatch to False
// (don't continue processing).
// Otherwise set it to True and call OnChar.
wxKeyEvent keyEvent( wxEVT_CHAR );
Display *display = (Display*)wxdisplay;
wxEventLoop evtLoop;
- XSync (display, FALSE);
+ XSync (display, False);
while (evtLoop.Pending())
{
return dest;
}
-static char *GetResourcePath(char *buf, const char *name, bool create = FALSE)
+static char *GetResourcePath(char *buf, const char *name, bool create = false)
{
if (create && wxFileExists (name) ) {
strcpy(buf, name);
{
const char *file = node->GetKeyString();
// If file doesn't exist, create it first.
- (void)GetResourcePath(nameBuffer, file, TRUE);
+ (void)GetResourcePath(nameBuffer, file, true);
XrmDatabase database = (XrmDatabase) node->Data ();
XrmPutFileDatabase (database, nameBuffer);
strncpy (*value, xvalue.addr, (int) xvalue.size);
return true;
}
- return FALSE;
+ return false;
}
bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file)
delete[] s;
return true;
}
- else return FALSE;
+ else return false;
}
bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file)
delete[] s;
return true;
}
- else return FALSE;
+ else return false;
}
bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file)
// Handle True, False here
// True, Yes, Enables, Set or Activated
if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A')
- *value = TRUE;
+ *value = true;
// False, No, Disabled, Reset, Cleared, Deactivated
else if (*s == 'F' || *s == 'N' || *s == 'D' || *s == 'R' || *s == 'C')
- *value = FALSE;
+ *value = false;
// Handle as Integer
else
*value = (int) strtol (s, NULL, 10);
return true;
}
else
- return FALSE;
+ return false;
}
void wxXMergeDatabases (wxApp * theApp, Display * display)
{
#if (XlibSpecificationRelease>=5)
XrmDatabase db = XtDatabase (dpy);
- XrmCombineDatabase (rdb, &db, FALSE);
+ XrmCombineDatabase (rdb, &db, False);
#else
XrmMergeDatabases (dpy->db, &rdb);
dpy->db = rdb;
return true;
}
else
- return FALSE;
+ return false;
}
}
// DoSetSizeIntr and DoMoveWindowIntr
// PROBLEM:
// under Motif composite controls (such as wxCalendarCtrl or generic wxSpinCtrl
-// did nott work and/or segfaulted because
+// did not work and/or segfaulted because
// 1) wxWindow::Create calls SetSize,
// which results in a call to DoSetSize much earlier than in the other ports
// 2) if wxWindow::Create is called (wxControl::Create calls it)
{
Widget w = (Widget)widget;
if ( !w )
- return FALSE;
+ return false;
// Rationale: a lot of common operations (including but not
// limited to moving, resizing and appending items to a listbox)
// XtUnmapWidget(w);
}
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
void wxWindow::Init()
{
// Motif-specific
- m_needsRefresh = TRUE;
+ m_needsRefresh = true;
m_mainWidget = (WXWidget) 0;
- m_winCaptured = FALSE;
+ m_winCaptured = false;
- m_isShown = TRUE;
+ m_isShown = true;
m_hScrollBar =
m_vScrollBar =
long style,
const wxString& name)
{
- wxCHECK_MSG( parent, FALSE, "can't create wxWindow without parent" );
+ wxCHECK_MSG( parent, false, "can't create wxWindow without parent" );
CreateBase(parent, id, pos, size, style, wxDefaultValidator, name);
// Scrolled widget needs to have its colour changed or we get a little blue
// square where the scrollbars abutt
wxColour backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
- wxDoChangeBackgroundColour(m_scrolledWindow, backgroundColour, TRUE);
- wxDoChangeBackgroundColour(m_drawingArea, backgroundColour, TRUE);
+ wxDoChangeBackgroundColour(m_scrolledWindow, backgroundColour, true);
+ wxDoChangeBackgroundColour(m_drawingArea, backgroundColour, true);
XmScrolledWindowSetAreas(
(Widget)m_scrolledWindow,
// sample).
SetCursor(*wxSTANDARD_CURSOR);
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
- DoSetSizeIntr(pos.x, pos.y, size.x,size.y, wxSIZE_AUTO, TRUE);
- return TRUE;
+ DoSetSizeIntr(pos.x, pos.y, size.x,size.y, wxSIZE_AUTO, true);
+ return true;
}
// Destructor
if (g_captureWindow == this)
g_captureWindow = NULL;
- m_isBeingDeleted = TRUE;
+ m_isBeingDeleted = true;
// Motif-specific actions first
WXWidget wMain = GetMainWidget();
m_hScrollBar = DoCreateScrollBar( m_scrolledWindow, wxHORIZONTAL,
(void (*)())wxScrollBarCallback );
- wxDoChangeBackgroundColour(m_hScrollBar, backgroundColour, TRUE);
+ wxDoChangeBackgroundColour(m_hScrollBar, backgroundColour, true);
XtRealizeWidget( (Widget)m_hScrollBar );
m_vScrollBar = DoCreateScrollBar( m_scrolledWindow, wxVERTICAL,
(void (*)())wxScrollBarCallback );
- wxDoChangeBackgroundColour(m_vScrollBar, backgroundColour, TRUE);
+ wxDoChangeBackgroundColour(m_vScrollBar, backgroundColour, true);
XtRealizeWidget((Widget)m_vScrollBar);
bool wxWindow::Enable(bool enable)
{
if ( !wxWindowBase::Enable(enable) )
- return FALSE;
+ return false;
Widget wMain = (Widget)GetMainWidget();
if ( wMain )
XmUpdateDisplay(wMain);
}
- return TRUE;
+ return true;
}
bool wxWindow::Show(bool show)
{
if ( !wxWindowBase::Show(show) )
- return FALSE;
+ return false;
if (m_borderWidget || m_scrolledWindow)
{
MapOrUnmap(GetMainWidget(), show);
}
- return TRUE;
+ return true;
}
// Raise the window to the top of the Z order
Widget wMain = (Widget)GetMainWidget();
if ( wMain )
- XtAddGrab(wMain, TRUE, FALSE);
+ XtAddGrab(wMain, True, False);
- m_winCaptured = TRUE;
+ m_winCaptured = true;
}
void wxWindow::DoReleaseMouse()
if ( wMain )
XtRemoveGrab(wMain);
- m_winCaptured = FALSE;
+ m_winCaptured = false;
}
bool wxWindow::SetFont(const wxFont& font)
if ( !wxWindowBase::SetFont(font) )
{
// nothing to do
- return FALSE;
+ return false;
}
ChangeFont();
- return TRUE;
+ return true;
}
bool wxWindow::SetCursor(const wxCursor& cursor)
if ( !wxWindowBase::SetCursor(cursor) )
{
// no change
- return FALSE;
+ return false;
}
// wxASSERT_MSG( m_cursor.Ok(),
Window win = XtWindow(w);
XDefineCursor((Display*) dpy, win, (Cursor) x_cursor);
- return TRUE;
+ return true;
}
// Coordinates relative to the window
XCopyArea(display, window, window, (GC) dc.GetGC(),
x1, y1, w1, h1, x2, y2);
- dc.SetAutoSetting(TRUE);
+ dc.SetAutoSetting(true);
wxBrush brush(GetBackgroundColour(), wxSOLID);
dc.SetBrush(brush); // FIXME: needed?
*/
if (menu->GetParent() && (menu->GetId() != -1))
- return FALSE;
+ return false;
if (menu->GetMainWidget())
{
- menu->DestroyMenu(TRUE);
+ menu->DestroyMenu(true);
}
menu->SetId(1); /* Mark as popped-up */
wxDoEventLoopIteration( evtLoop );
}
- return TRUE;
+ return true;
}
#endif
bool wxWindow::PreResize()
{
- return TRUE;
+ return true;
}
// Get total size
void wxWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
- DoSetSizeIntr(x, y, width, height, sizeFlags, FALSE);
+ DoSetSizeIntr(x, y, width, height, sizeFlags, false);
}
void wxWindow::DoSetSizeIntr(int x, int y, int width, int height,
void wxWindow::Refresh(bool eraseBack, const wxRect *rect)
{
- m_needsRefresh = TRUE;
+ m_needsRefresh = true;
Display *display = XtDisplay((Widget) GetMainWidget());
Window thisWindow = XtWindow((Widget) GetMainWidget());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
- m_needsRefresh = FALSE;
+ m_needsRefresh = false;
}
}
{
#if wxUSE_ACCEL
if (!m_acceleratorTable.Ok())
- return FALSE;
+ return false;
int count = m_acceleratorTable.GetCount();
wxAcceleratorEntry* entries = m_acceleratorTable.GetEntries();
parent = parent->GetParent();
if (!parent)
- return FALSE;
+ return false;
wxFrame* frame = wxDynamicCast(parent, wxFrame);
if ( frame )
wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, entry->GetCommand());
commandEvent.SetEventObject(frame);
- // If ProcessEvent returns TRUE (it was handled), then
+ // If ProcessEvent returns true (it was handled), then
// the calling code will skip the event handling.
return frame->GetEventHandler()->ProcessEvent(commandEvent);
}
// No such child
if (!child)
- return FALSE;
+ return false;
// Now we process those kinds of windows that we can.
// For now, only buttons.
return child->GetEventHandler()->ProcessEvent(commandEvent);
}
- return FALSE;
+ return false;
} // matches event
}// for
#endif
// We didn't match the key event against an accelerator.
- return FALSE;
+ return false;
}
// ============================================================================
{
wxLogDebug("Widget table clash: new widget is %ld, %s",
(long)w, win->GetClassInfo()->GetClassName());
- return FALSE;
+ return false;
}
wxWidgetHashTable->Put((long) w, win);
wxLogTrace("widget", "Widget 0x%p <-> window %p (%s)",
(WXWidget)w, win, win->GetClassInfo()->GetClassName());
- return TRUE;
+ return true;
}
wxWindow *wxGetWindowFromTable(Widget w)
if (formWidget)
{
if (!wxAddWindowToTable((Widget) formWidget, this))
- return FALSE;
+ return false;
XtTranslations ptr;
XtOverrideTranslations ((Widget) formWidget,
(XtPointer)this);
wxDeleteWindowFromTable((Widget) widget);
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
}
// TODO: probably the key to allowing default behaviour to happen. Say we
- // set a m_doDefault flag to FALSE at the start of this function. Then in
+ // set a m_doDefault flag to false at the start of this function. Then in
// e.g. wxWindow::OnMouseEvent we can call Default() which sets this flag to
- // TRUE, indicating that default processing can happen. Thus, behaviour can
+ // true, indicating that default processing can happen. Thus, behaviour can
// appear to be overridden just by adding an event handler and not calling
// wxWindow::OnWhatever. ALSO, maybe we can use this instead of the current
// way of handling drawing area events, to simplify things.
eventType = wxEVT_RIGHT_UP;
}
else
- return FALSE;
+ return false;
}
else
{
- return FALSE;
+ return false;
}
wxevent.SetEventType(eventType);
wxevent.SetId(win->GetId());
wxevent.SetEventObject(win);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win,
id = toupper(id);
if (xevent->xkey.state & ShiftMask)
- wxevent.m_shiftDown = TRUE;
+ wxevent.m_shiftDown = true;
if (xevent->xkey.state & ControlMask)
- wxevent.m_controlDown = TRUE;
+ wxevent.m_controlDown = true;
if (xevent->xkey.state & Mod3Mask)
- wxevent.m_altDown = TRUE;
+ wxevent.m_altDown = true;
if (xevent->xkey.state & Mod1Mask)
- wxevent.m_metaDown = TRUE;
+ wxevent.m_metaDown = true;
wxevent.SetEventObject(win);
wxevent.m_keyCode = id;
wxevent.SetTimestamp(xevent->xkey.time);
wxevent.m_y = xevent->xbutton.y;
if (id > -1)
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
break;
}
default:
break;
}
- return FALSE;
+ return false;
}
// ----------------------------------------------------------------------------
bool wxWindow::SetBackgroundColour(const wxColour& col)
{
if ( !wxWindowBase::SetBackgroundColour(col) )
- return FALSE;
+ return false;
ChangeBackgroundColour();
- return TRUE;
+ return true;
}
bool wxWindow::SetForegroundColour(const wxColour& col)
{
if ( !wxWindowBase::SetForegroundColour(col) )
- return FALSE;
+ return false;
ChangeForegroundColour();
- return TRUE;
+ return true;
}
void wxWindow::ChangeFont(bool keepOriginalSize)