my wxMotif fixes (merged with Robert's changes), wxMotif compiles, links
and runs... until you click in the menu, that is. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2929 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/dialog.h
|
||||
// Purpose: wxDialogBase class
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 29.06.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DIALOG_H_BASE_
|
||||
#define _WX_DIALOG_H_BASE_
|
||||
|
||||
@@ -6,6 +17,12 @@
|
||||
|
||||
class WXDLLEXPORT wxDialogBase : public wxPanel
|
||||
{
|
||||
public:
|
||||
// the modal dialogs have a return code - usually the id of the last
|
||||
// pressed button
|
||||
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
|
||||
int GetReturnCode() const { return m_returnCode; }
|
||||
|
||||
protected:
|
||||
// functions to help with dialog layout
|
||||
// ------------------------------------
|
||||
@@ -43,6 +60,9 @@ protected:
|
||||
// as the height of just text which may be retrieved from
|
||||
// wxGetCharHeight())
|
||||
long GetStandardTextHeight();
|
||||
|
||||
// the return code from modal dialog
|
||||
int m_returnCode;
|
||||
};
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
|
@@ -2,8 +2,9 @@
|
||||
// Name: gridg.h
|
||||
// Purpose: wxGenericGrid
|
||||
// Author: Julian Smart
|
||||
// Modified by: Michael Bedward 20 April 1999
|
||||
// Added edit in place facility
|
||||
// Modified by: Michael Bedward
|
||||
// Added edit in place facility, 20 April 1999
|
||||
// Added cursor key control, 29 Jun 1999
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
@@ -226,7 +227,9 @@ public:
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnText(wxCommandEvent& ev);
|
||||
void OnTextEnter(wxCommandEvent& ev);
|
||||
void OnTextInPlace(wxCommandEvent& ev);
|
||||
void OnTextInPlaceEnter(wxCommandEvent& ev);
|
||||
void OnGridScroll(wxScrollEvent& ev);
|
||||
|
||||
protected:
|
||||
|
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
class WXDLLEXPORT wxTextCtrl;
|
||||
|
||||
// Handy dialog functions (will be converted into classes at some point)
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxGetTextFromUserPromptStr;
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
|
||||
|
@@ -87,9 +87,6 @@ public:
|
||||
virtual void Maximize() { }
|
||||
virtual void Restore() { }
|
||||
|
||||
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
|
||||
int GetReturnCode() const { return m_returnCode; }
|
||||
|
||||
// implementation
|
||||
|
||||
virtual void GtkOnSize( int x, int y, int width, int height );
|
||||
@@ -108,8 +105,6 @@ protected:
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
private:
|
||||
int m_returnCode;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
@@ -87,9 +87,6 @@ public:
|
||||
virtual void Maximize() { }
|
||||
virtual void Restore() { }
|
||||
|
||||
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
|
||||
int GetReturnCode() const { return m_returnCode; }
|
||||
|
||||
// implementation
|
||||
|
||||
virtual void GtkOnSize( int x, int y, int width, int height );
|
||||
@@ -108,8 +105,6 @@ protected:
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
private:
|
||||
int m_returnCode;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
@@ -20,11 +20,11 @@
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/setup.h"
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
|
||||
#include "wx/dataobj.h"
|
||||
|
||||
#include "wx/list.h"
|
||||
#include "wx/module.h"
|
||||
|
||||
bool WXDLLEXPORT wxOpenClipboard();
|
||||
@@ -170,5 +170,7 @@ WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
|
||||
#endif
|
||||
// Old clipboard class
|
||||
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
|
||||
#endif
|
||||
// _WX_CLIPBRD_H_
|
||||
|
@@ -16,12 +16,10 @@
|
||||
#pragma interface "dialog.h"
|
||||
#endif
|
||||
|
||||
#include "wx/panel.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
|
||||
|
||||
// Dialog boxes
|
||||
class WXDLLEXPORT wxDialog : public wxPanel
|
||||
class WXDLLEXPORT wxDialog : public wxDialogBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDialog)
|
||||
|
||||
@@ -67,35 +65,18 @@ public:
|
||||
void Lower();
|
||||
|
||||
virtual bool IsIconized() const;
|
||||
void Fit();
|
||||
|
||||
void SetTitle(const wxString& title);
|
||||
wxString GetTitle() const ;
|
||||
|
||||
// bool OnClose();
|
||||
void OnCharHook(wxKeyEvent& event);
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
void SetModal(bool flag);
|
||||
|
||||
virtual void Centre(int direction = wxBOTH);
|
||||
virtual bool IsModal() const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
||||
virtual bool IsModal() const
|
||||
{ return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
||||
|
||||
virtual int ShowModal();
|
||||
virtual void EndModal(int retCode);
|
||||
|
||||
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
|
||||
int GetReturnCode() const { return m_returnCode; }
|
||||
|
||||
// Standard buttons
|
||||
void OnOK(wxCommandEvent& event);
|
||||
void OnApply(wxCommandEvent& event);
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
void OnPaint(wxPaintEvent &event);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont(bool keepOriginalSize = TRUE);
|
||||
virtual void ChangeBackgroundColour();
|
||||
@@ -103,11 +84,24 @@ public:
|
||||
inline WXWidget GetTopWidget() const { return m_mainWidget; }
|
||||
inline WXWidget GetClientWidget() const { return m_mainWidget; }
|
||||
|
||||
// Standard buttons
|
||||
void OnOK(wxCommandEvent& event);
|
||||
void OnApply(wxCommandEvent& event);
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
|
||||
void OnPaint(wxPaintEvent &event);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
// bool OnClose();
|
||||
void OnCharHook(wxKeyEvent& event);
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
public:
|
||||
//// Motif-specific
|
||||
bool m_modalShowing;
|
||||
wxString m_dialogTitle;
|
||||
int m_returnCode;
|
||||
|
||||
protected:
|
||||
virtual void DoSetSize(int x, int y,
|
||||
|
@@ -173,6 +173,10 @@ public:
|
||||
void ClearUpdateRegion() { m_updateRegion.Clear(); }
|
||||
void SetUpdateRegion(const wxRegion& region) { m_updateRegion = region; }
|
||||
|
||||
// sets the fore/background colour for the given widget
|
||||
static void DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour);
|
||||
static void DoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE);
|
||||
|
||||
protected:
|
||||
// event handlers (not virtual by design)
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
@@ -212,8 +216,6 @@ protected:
|
||||
public:
|
||||
// Change properties
|
||||
virtual void ChangeFont(bool keepOriginalSize = TRUE); // Change to the current font (often overridden)
|
||||
virtual void DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour);
|
||||
virtual void DoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE);
|
||||
|
||||
// Change background and foreground colour using current background colour
|
||||
// setting (Motif generates foreground based on background)
|
||||
|
@@ -60,9 +60,6 @@ public:
|
||||
|
||||
~wxDialog();
|
||||
|
||||
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
|
||||
int GetReturnCode() const { return m_returnCode; }
|
||||
|
||||
virtual bool Destroy();
|
||||
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
@@ -132,8 +129,7 @@ private:
|
||||
WXHWND m_hwndToolTip;
|
||||
#endif // tooltips
|
||||
|
||||
int m_returnCode;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
@@ -2,8 +2,9 @@
|
||||
// Name: gridg.cpp
|
||||
// Purpose: wxGenericGrid
|
||||
// Author: Julian Smart
|
||||
// Modified by: Michael Bedward 20 Apr 1999
|
||||
// Added edit in place facility
|
||||
// Modified by: Michael Bedward
|
||||
// Added edit in place facility, 20 Apr 1999
|
||||
// Added cursor key control, 29 Jun 1999
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
@@ -27,13 +28,14 @@
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/settings.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "wx/string.h"
|
||||
|
||||
#include "wx/generic/gridg.h"
|
||||
#include "wx/settings.h"
|
||||
|
||||
// Set to zero to use no double-buffering
|
||||
#ifdef __WXMSW__
|
||||
@@ -56,6 +58,8 @@ BEGIN_EVENT_TABLE(wxGenericGrid, wxPanel)
|
||||
EVT_MOUSE_EVENTS(wxGenericGrid::OnMouseEvent)
|
||||
EVT_TEXT(wxGRID_TEXT_CTRL, wxGenericGrid::OnText)
|
||||
EVT_TEXT(wxGRID_EDIT_IN_PLACE_TEXT_CTRL, wxGenericGrid::OnTextInPlace)
|
||||
EVT_TEXT_ENTER(wxGRID_TEXT_CTRL, wxGenericGrid::OnTextEnter)
|
||||
EVT_TEXT_ENTER(wxGRID_EDIT_IN_PLACE_TEXT_CTRL, wxGenericGrid::OnTextInPlaceEnter)
|
||||
EVT_COMMAND_SCROLL(wxGRID_HSCROLL, wxGenericGrid::OnGridScroll)
|
||||
EVT_COMMAND_SCROLL(wxGRID_VSCROLL, wxGenericGrid::OnGridScroll)
|
||||
|
||||
@@ -215,7 +219,7 @@ bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos,
|
||||
m_textItem = new wxTextCtrl(m_editingPanel, wxGRID_TEXT_CTRL, "",
|
||||
wxPoint(m_editControlPosition.x, m_editControlPosition.y),
|
||||
wxSize(m_editControlPosition.width, -1),
|
||||
0);
|
||||
wxTE_PROCESS_ENTER);
|
||||
m_textItem->Show(TRUE);
|
||||
m_textItem->SetFocus();
|
||||
int controlW, controlH;
|
||||
@@ -235,7 +239,7 @@ bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos,
|
||||
m_inPlaceTextItem = new wxTextCtrl( (wxPanel*)this, wxGRID_EDIT_IN_PLACE_TEXT_CTRL, "",
|
||||
wxPoint( m_currentRect.x-2, m_currentRect.y-2 ),
|
||||
wxSize( m_currentRect.width+4, m_currentRect.height+4 ),
|
||||
wxNO_BORDER );
|
||||
wxNO_BORDER | wxTE_PROCESS_ENTER );
|
||||
m_inPlaceTextItem->Show(TRUE);
|
||||
m_inPlaceTextItem->SetFocus();
|
||||
|
||||
@@ -2585,6 +2589,25 @@ void wxGenericGrid::OnText(wxCommandEvent& WXUNUSED(ev) )
|
||||
}
|
||||
}
|
||||
|
||||
void wxGenericGrid::OnTextEnter(wxCommandEvent& WXUNUSED(ev) )
|
||||
{
|
||||
// move the cursor down the current row (if possible)
|
||||
// when the enter key has been pressed
|
||||
//
|
||||
if ( m_editable )
|
||||
{
|
||||
if ( GetCursorRow() < GetRows()-1 )
|
||||
{
|
||||
wxClientDC dc( this );
|
||||
dc.BeginDrawing();
|
||||
OnSelectCellImplementation(& dc,
|
||||
GetCursorRow()+1,
|
||||
GetCursorColumn() );
|
||||
dc.EndDrawing();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxGenericGrid::OnTextInPlace(wxCommandEvent& ev )
|
||||
{
|
||||
if ( m_editable )
|
||||
@@ -2601,6 +2624,25 @@ void wxGenericGrid::OnTextInPlace(wxCommandEvent& ev )
|
||||
}
|
||||
}
|
||||
|
||||
void wxGenericGrid::OnTextInPlaceEnter(wxCommandEvent& WXUNUSED(ev) )
|
||||
{
|
||||
// move the cursor down the current row (if possible)
|
||||
// when the enter key has been pressed
|
||||
//
|
||||
if ( m_editable )
|
||||
{
|
||||
if ( GetCursorRow() < GetRows()-1 )
|
||||
{
|
||||
wxClientDC dc( this );
|
||||
dc.BeginDrawing();
|
||||
OnSelectCellImplementation(& dc,
|
||||
GetCursorRow()+1,
|
||||
GetCursorColumn() );
|
||||
dc.EndDrawing();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxGenericGrid::OnGridScroll(wxScrollEvent& ev)
|
||||
{
|
||||
static bool inScroll = FALSE;
|
||||
|
@@ -28,8 +28,7 @@
|
||||
#include "wx/statbmp.h"
|
||||
#include "wx/layout.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/icon.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -169,11 +168,11 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
|
||||
|
||||
// get the longest caption and also calc the number of buttons
|
||||
size_t nBtn, nButtons = 0;
|
||||
long width, widthBtnMax = 0;
|
||||
int width, widthBtnMax = 0;
|
||||
for ( nBtn = 0; nBtn < Btn_Max; nBtn++ ) {
|
||||
if ( buttons[nBtn] ) {
|
||||
nButtons++;
|
||||
dc.GetTextExtent(buttons[nBtn]->GetLabel(), &width, NULL);
|
||||
GetTextExtent(buttons[nBtn]->GetLabel(), &width, NULL);
|
||||
if ( width > widthBtnMax )
|
||||
widthBtnMax = width;
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "windowbase.h"
|
||||
#pragma implementation "tipdlg.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
@@ -36,6 +36,11 @@
|
||||
#include "wx/statbox.h"
|
||||
#include "wx/statbmp.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/layout.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/textctrl.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/statline.h"
|
||||
@@ -175,7 +180,7 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
|
||||
wxIcon icon("wxICON_TIP");
|
||||
#else
|
||||
#include "wx/generic/tip.xpm"
|
||||
wxIcon icon(info);
|
||||
wxIcon icon(tipIcon);
|
||||
#endif
|
||||
|
||||
wxStaticBitmap *bmp = new wxStaticBitmap(this, -1, icon);
|
||||
|
@@ -14,8 +14,6 @@ LIBS = $(GUILIBS)
|
||||
|
||||
VPATH = .:${srcdir}:${srcdir}/../common:${srcdir}/../generic:${EXTRA_VPATH}
|
||||
|
||||
EXTRA_DIST = "${srcdir}/../common ${srcdir}/../generic ${srcdir}"
|
||||
|
||||
lib_LTLIBRARIES = @WX_LIBRARY_NAME@
|
||||
EXTRA_LTLIBRARIES = libwx_gtk.la libwx_motif.la libwx_msw.la
|
||||
|
||||
|
@@ -14,8 +14,6 @@ LIBS = $(GUILIBS)
|
||||
|
||||
VPATH = .:${srcdir}:${srcdir}/../common:${srcdir}/../generic:${EXTRA_VPATH}
|
||||
|
||||
EXTRA_DIST = "${srcdir}/../common ${srcdir}/../generic ${srcdir}"
|
||||
|
||||
lib_LTLIBRARIES = @WX_LIBRARY_NAME@
|
||||
EXTRA_LTLIBRARIES = libwx_gtk.la libwx_motif.la libwx_msw.la
|
||||
|
||||
|
@@ -54,6 +54,7 @@ libwx_motif_la_SOURCES = \
|
||||
db.cpp \
|
||||
dbtable.cpp \
|
||||
dcbase.cpp \
|
||||
dlgcmn.cpp \
|
||||
docmdi.cpp \
|
||||
docview.cpp \
|
||||
dynlib.cpp \
|
||||
@@ -129,6 +130,7 @@ libwx_motif_la_SOURCES = \
|
||||
statusbr.cpp \
|
||||
tabg.cpp \
|
||||
textdlgg.cpp \
|
||||
tipdlg.cpp \
|
||||
treectrl.cpp \
|
||||
\
|
||||
threadpsx.cpp \
|
||||
|
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "wx/button.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/panel.h"
|
||||
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/PushB.h>
|
||||
@@ -88,12 +89,10 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
|
||||
void wxButton::SetDefault()
|
||||
{
|
||||
wxWindow *parent = (wxWindow *)GetParent();
|
||||
/*
|
||||
TODO
|
||||
if (parent)
|
||||
parent->SetDefaultItem(this);
|
||||
*/
|
||||
wxWindow *parent = GetParent();
|
||||
wxPanel *panel = wxDynamicCast(panel, wxPanel);
|
||||
if ( panel )
|
||||
panel->SetDefaultItem(this);
|
||||
|
||||
// We initially do not set XmNdefaultShadowThickness, to have small buttons.
|
||||
// Unfortunately, buttons are now mis-aligned. We try to correct this
|
||||
|
@@ -119,9 +119,10 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
// that I have found the code responsible for this behaviour.
|
||||
#if XmVersion >= 1002
|
||||
#if XmVersion < 2000
|
||||
Widget optionLabel = XmOptionLabelGadget ((Widget) m_buttonWidget);
|
||||
// JACS, 24/1/99: this seems to cause a malloc crash later on, e.g.
|
||||
// in controls sample.
|
||||
//
|
||||
// Widget optionLabel = XmOptionLabelGadget ((Widget) m_buttonWidget);
|
||||
// XtUnmanageChild (optionLabel);
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -14,6 +14,10 @@
|
||||
#pragma implementation "clipbrd.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
|
||||
#include "wx/app.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/bitmap.h"
|
||||
@@ -529,3 +533,4 @@ char *wxClipboard::GetClipboardData(char *format, long *length, long time)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/panel.h"
|
||||
#include "wx/utils.h"
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
@@ -38,15 +39,12 @@ wxControl::~wxControl()
|
||||
{
|
||||
// If we delete an item, we should initialize the parent panel,
|
||||
// because it could now be invalid.
|
||||
/*
|
||||
TODO
|
||||
wxWindow *parent = (wxWindow *)GetParent();
|
||||
if (parent)
|
||||
wxPanel *panel = wxDynamicCast(GetParent(), wxPanel);
|
||||
if (panel)
|
||||
{
|
||||
if (parent->GetDefaultItem() == (wxButton*) this)
|
||||
parent->SetDefaultItem((wxButton*) NULL);
|
||||
if (panel->GetDefaultItem() == this)
|
||||
panel->SetDefaultItem((wxButton*) NULL);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void wxControl::SetLabel(const wxString& label)
|
||||
|
@@ -11,6 +11,10 @@
|
||||
#pragma implementation "dataobj.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
|
||||
#include "wx/dataobj.h"
|
||||
#include "wx/app.h"
|
||||
|
||||
@@ -298,3 +302,4 @@ void wxPrivateDataObject::WriteData( const void *data, void *dest ) const
|
||||
memcpy( dest, data, GetSize() );
|
||||
}
|
||||
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
|
@@ -369,35 +369,6 @@ wxString wxDialog::GetTitle() const
|
||||
return m_dialogTitle;
|
||||
}
|
||||
|
||||
void wxDialog::Centre(int direction)
|
||||
{
|
||||
int x_offset,y_offset ;
|
||||
int display_width, display_height;
|
||||
int width, height, x, y;
|
||||
wxWindow *parent = GetParent();
|
||||
if ((direction & wxCENTER_FRAME) && parent)
|
||||
{
|
||||
parent->GetPosition(&x_offset,&y_offset) ;
|
||||
parent->GetSize(&display_width,&display_height) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
wxDisplaySize(&display_width, &display_height);
|
||||
x_offset = 0 ;
|
||||
y_offset = 0 ;
|
||||
}
|
||||
|
||||
GetSize(&width, &height);
|
||||
GetPosition(&x, &y);
|
||||
|
||||
if (direction & wxHORIZONTAL)
|
||||
x = (int)((display_width - width)/2);
|
||||
if (direction & wxVERTICAL)
|
||||
y = (int)((display_height - height)/2);
|
||||
|
||||
SetSize(x+x_offset, y+y_offset, width, height);
|
||||
}
|
||||
|
||||
void wxDialog::Raise()
|
||||
{
|
||||
Window parent_window = XtWindow((Widget) m_mainWidget),
|
||||
@@ -607,11 +578,6 @@ void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void wxDialog::Fit()
|
||||
{
|
||||
wxWindow::Fit();
|
||||
}
|
||||
|
||||
// Handle a close event from the window manager
|
||||
static void wxCloseDialogCallback( Widget WXUNUSED(widget), XtPointer client_data,
|
||||
XmAnyCallbackStruct *WXUNUSED(cbs))
|
||||
@@ -629,7 +595,7 @@ void wxDialogBoxEventHandler (Widget wid,
|
||||
XEvent* event,
|
||||
Boolean* continueToDispatch)
|
||||
{
|
||||
wxDialog *dialog = (wxDialog *)wxWidgetHashTable->Get((long)wid);
|
||||
wxDialog *dialog = (wxDialog *)wxGetWindowFromTable(wid);
|
||||
if (dialog)
|
||||
{
|
||||
wxMouseEvent wxevent(wxEVT_NULL);
|
||||
|
@@ -145,11 +145,11 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
||||
|
||||
static void wxChangeListBoxColours(wxWindow* win, Widget widget)
|
||||
{
|
||||
win->DoChangeBackgroundColour((WXWidget) widget, *wxWHITE);
|
||||
wxWindow::DoChangeBackgroundColour((WXWidget) widget, *wxWHITE);
|
||||
|
||||
// Change colour of the scrolled areas of the listboxes
|
||||
Widget listParent = XtParent (widget);
|
||||
win->DoChangeBackgroundColour((WXWidget) listParent, *wxWHITE, TRUE);
|
||||
wxWindow::DoChangeBackgroundColour((WXWidget) listParent, *wxWHITE, TRUE);
|
||||
|
||||
Widget hsb = (Widget) 0;
|
||||
Widget vsb = (Widget) 0;
|
||||
@@ -162,8 +162,8 @@ static void wxChangeListBoxColours(wxWindow* win, Widget widget)
|
||||
* function to change them (by default, taken from wxSystemSettings)
|
||||
*/
|
||||
wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
|
||||
win->DoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE);
|
||||
win->DoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE);
|
||||
wxWindow::DoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE);
|
||||
wxWindow::DoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE);
|
||||
|
||||
if (hsb)
|
||||
XtVaSetValues (hsb,
|
||||
@@ -195,9 +195,13 @@ int wxFileDialog::ShowModal()
|
||||
Widget selectionWidget = XmFileSelectionBoxGetChild(fileSel, XmDIALOG_TEXT);
|
||||
Widget dirListWidget = XmFileSelectionBoxGetChild(fileSel, XmDIALOG_DIR_LIST);
|
||||
Widget fileListWidget = XmFileSelectionBoxGetChild(fileSel, XmDIALOG_LIST);
|
||||
|
||||
// code using these vars disabled
|
||||
#if 0
|
||||
Widget okWidget = XmFileSelectionBoxGetChild(fileSel, XmDIALOG_OK_BUTTON);
|
||||
Widget applyWidget = XmFileSelectionBoxGetChild(fileSel, XmDIALOG_APPLY_BUTTON);
|
||||
Widget cancelWidget = XmFileSelectionBoxGetChild(fileSel, XmDIALOG_CANCEL_BUTTON);
|
||||
#endif
|
||||
|
||||
|
||||
Widget shell = XtParent(fileSel);
|
||||
@@ -273,11 +277,12 @@ int wxFileDialog::ShowModal()
|
||||
DoChangeBackgroundColour((WXWidget) filterWidget, *wxWHITE);
|
||||
DoChangeBackgroundColour((WXWidget) selectionWidget, *wxWHITE);
|
||||
|
||||
/* For some reason this crashes
|
||||
// apparently, this provokes a crash
|
||||
#if 0
|
||||
DoChangeBackgroundColour((WXWidget) okWidget, m_backgroundColour, TRUE);
|
||||
DoChangeBackgroundColour((WXWidget) cancelWidget, m_backgroundColour, TRUE);
|
||||
DoChangeBackgroundColour((WXWidget) applyWidget, m_backgroundColour, TRUE);
|
||||
*/
|
||||
#endif
|
||||
|
||||
wxChangeListBoxColours(this, dirListWidget);
|
||||
wxChangeListBoxColours(this, fileListWidget);
|
||||
@@ -329,17 +334,18 @@ wxDefaultFileSelector(bool load, const char *what, const char *extension, const
|
||||
{
|
||||
char *ext = (char *)extension;
|
||||
|
||||
char prompt[50];
|
||||
wxString prompt;
|
||||
wxString str;
|
||||
if (load)
|
||||
str = "Load %s file";
|
||||
str = _("Load %s file");
|
||||
else
|
||||
str = "Save %s file";
|
||||
sprintf(prompt, wxGetTranslation(str), what);
|
||||
str = _("Save %s file");
|
||||
prompt.Printf(str, what);
|
||||
|
||||
if (*ext == '.') ext++;
|
||||
char wild[60];
|
||||
sprintf(wild, "*.%s", ext);
|
||||
if (*ext == '.')
|
||||
ext++;
|
||||
wxString wild;
|
||||
wild.Printf("*.%s", ext);
|
||||
|
||||
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
|
||||
}
|
||||
|
@@ -35,13 +35,13 @@ wxXFont::wxXFont()
|
||||
|
||||
wxXFont::~wxXFont()
|
||||
{
|
||||
XFontStruct* fontStruct = (XFontStruct*) m_fontStruct;
|
||||
XmFontList fontList = (XmFontList) m_fontList;
|
||||
|
||||
XmFontListFree (fontList);
|
||||
|
||||
// TODO: why does freeing the font produce a segv???
|
||||
// Note that XFreeFont wasn't called in wxWin 1.68 either.
|
||||
// XFontStruct* fontStruct = (XFontStruct*) m_fontStruct;
|
||||
// XFreeFont((Display*) m_display, fontStruct);
|
||||
}
|
||||
|
||||
|
@@ -202,7 +202,8 @@ bool wxFrame::Create(wxWindow *parent,
|
||||
XtManageChild((Widget) m_clientArea);
|
||||
XtManageChild((Widget) m_workArea);
|
||||
|
||||
wxASSERT_MSG ((wxWidgetHashTable->Get((long)m_workArea) == (wxObject*) NULL), "Widget table clash in frame.cpp") ;
|
||||
wxASSERT_MSG( !wxGetWindowFromTable((Widget)m_workArea),
|
||||
"Widget table clash in frame.cpp") ;
|
||||
|
||||
wxAddWindowToTable((Widget) m_workArea, this);
|
||||
|
||||
@@ -1042,10 +1043,9 @@ void wxFrame::Lower(void)
|
||||
void wxFrameFocusProc(Widget workArea, XtPointer clientData,
|
||||
XmAnyCallbackStruct *cbs)
|
||||
{
|
||||
wxFrame *frame = (wxFrame *)clientData;
|
||||
|
||||
// wxDebugMsg("focus proc from frame %ld\n",(long)frame);
|
||||
// TODO
|
||||
// wxFrame *frame = (wxFrame *)clientData;
|
||||
// frame->GetEventHandler()->OnSetFocus();
|
||||
}
|
||||
|
||||
@@ -1053,7 +1053,7 @@ void wxFrameFocusProc(Widget workArea, XtPointer clientData,
|
||||
static void wxFrameMapProc(Widget frameShell, XtPointer clientData,
|
||||
XCrossingEvent * event)
|
||||
{
|
||||
wxFrame *frame = (wxFrame *)wxWidgetHashTable->Get((long)clientData);
|
||||
wxFrame *frame = (wxFrame *)wxGetWindowFromTable((Widget)clientData);
|
||||
|
||||
if (frame) {
|
||||
XEvent *e = (XEvent *)event;
|
||||
|
@@ -317,8 +317,8 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
||||
|
||||
SetMDIParentFrame(parent);
|
||||
|
||||
int x = pos.x; int y = pos.y;
|
||||
int width = size.x; int height = size.y;
|
||||
int width = size.x;
|
||||
int height = size.y;
|
||||
if (width == -1)
|
||||
width = 200; // TODO: give reasonable default
|
||||
if (height == -1)
|
||||
|
@@ -144,7 +144,6 @@ bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op)
|
||||
rect.height = height;
|
||||
XUnionRectWithRegion(&rect, rectRegion, rectRegion);
|
||||
|
||||
int mode = 0; // TODO platform-specific code
|
||||
switch (op)
|
||||
{
|
||||
case wxRGN_AND:
|
||||
@@ -183,7 +182,6 @@ bool wxRegion::Combine(const wxRegion& region, wxRegionOp op)
|
||||
m_refData = new wxRegionRefData(*ref);
|
||||
}
|
||||
|
||||
int mode = 0; // TODO platform-specific code
|
||||
switch (op)
|
||||
{
|
||||
case wxRGN_AND:
|
||||
|
Reference in New Issue
Block a user