by one index, and a crash (probably a Motif bug).
Improved wxSpinButton appearance.
Fixed some build warnings here and there in the samples,
removed use of deprecated wxList methods in prntdlgg.cpp, fixed
aot-of-range ID in tipdlg.cpp, fixed some errors detected by
valgrind.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19825
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
DECLARE_DYNAMIC_CLASS(wxComboBox)
public:
- wxComboBox() {}
+ wxComboBox() { m_inSetSelection = false; }
~wxComboBox();
inline wxComboBox(wxWindow *parent, wxWindowID id,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
+ m_inSetSelection = false;
Create(parent, id, value, pos, size, n, choices,
style, validator, name);
}
private:
// only implemented for native combo box
void AdjustDropDownListSize();
+
+ // implementation detail, should really be private
+public:
+ bool m_inSetSelection;
};
#endif
#include "wx/defs.h"
#include "X11/Xlib.h"
+class WXDLLEXPORT wxFont;
+class WXDLLEXPORT wxWindow;
+class WXDLLEXPORT wxSize;
+
#include "wx/x11/privx.h"
// Put any private declarations here: native Motif types may be used because
wxMenuBar *menu_bar = new wxMenuBar();
menu_bar->Append(file_menu, _T("&File"));
-
+
+ SetIcon(wxICON(mondrian));
SetMenuBar( menu_bar );
CreateStatusBar(2);
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",\r
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",\r
" "\r
-};
\ No newline at end of file
+};\r
#include "wx/dynarray.h"
#include "wx/arrimpl.cpp"
#include "wx/dcclient.h"
-#include "wx/msgdlg.h"
// ----------------------------------------------------------------------------
#ifndef WX_PRECOMP
#include "wx/utils.h"
#include "wx/dc.h"
- #include "wx/app.h"
- #include "wx/frame.h"
#include "wx/stattext.h"
#include "wx/statbox.h"
#include "wx/button.h"
#include "wx/textctrl.h"
#include "wx/radiobox.h"
#include "wx/filedlg.h"
- #include "wx/choice.h"
#include "wx/combobox.h"
#include "wx/intl.h"
#include "wx/sizer.h"
int selectedItem = m_paperTypeChoice->GetSelection();
if (selectedItem != -1)
{
- wxPrintPaperType *paper = (wxPrintPaperType *)wxThePrintPaperDatabase->Nth(selectedItem)->Data();
+ wxPrintPaperType *paper = (wxPrintPaperType*)wxThePrintPaperDatabase->Item(selectedItem)->GetData();
if (paper != NULL)
m_printData.SetPaperId( paper->GetId());
}
int selectedItem = m_paperTypeChoice->GetSelection();
if (selectedItem != -1)
{
- wxPrintPaperType *paper = (wxPrintPaperType *)wxThePrintPaperDatabase->Nth(selectedItem)->Data();
+ wxPrintPaperType *paper = (wxPrintPaperType*)wxThePrintPaperDatabase->Item(selectedItem)->GetData();
if ( paper )
{
m_pageData.SetPaperSize(wxSize(paper->GetWidth()/10, paper->GetHeight()/10));
// constants
// ----------------------------------------------------------------------------
-static const int wxID_NEXT_TIP = -100; // whatever
+static const int wxID_NEXT_TIP = 32000; // whatever
// ----------------------------------------------------------------------------
// private classes
{
m_inSetValue = true;
+ // Fix crash; probably an OpenMotif bug
+ const char* val = value.c_str() ? value.c_str() : "";
XtVaSetValues( GetXmText(this),
- XmNvalue, wxConstCast(value.c_str(), char),
+ XmNvalue, wxConstCast(val, char),
NULL);
m_inSetValue = false;
void wxComboBox::SetSelection (int n)
{
+ m_inSetSelection = true;
+
#if wxCHECK_LESSTIF()
XmListSelectPos (GetXmList(this), n + 1, false);
SetValue(GetString(n));
XmNselectedPosition, n,
NULL );
#endif
+
+ m_inSetSelection = false;
}
int wxComboBox::GetSelection (void) const
{
wxComboBox *item = (wxComboBox *) clientData;
+ if( item->m_inSetSelection ) return;
+
switch (cbs->reason)
{
case XmCR_SELECT:
{
wxCommandEvent event (wxEVT_COMMAND_COMBOBOX_SELECTED,
item->GetId());
- int idx = cbs->item_position - 1;
+ int idx = cbs->item_position;
event.m_commandInt = idx;
event.m_commandString = item->GetString (idx);
if ( item->HasClientObjectData() )
event.SetClientData( item->GetClientData(idx) );
event.m_extraLong = true;
event.SetEventObject(item);
- item->ProcessCommand (event);
+ item->GetEventHandler()->ProcessEvent(event);
break;
}
case XmCR_VALUE_CHANGED:
event.m_commandString = item->GetValue();
event.m_extraLong = true;
event.SetEventObject(item);
- item->ProcessCommand (event);
+ item->GetEventHandler()->ProcessEvent(event);
break;
}
default:
#include "wx/app.h"
#include "wx/utils.h"
#include "wx/list.h"
+#include "wx/window.h"
#if wxUSE_IMAGE
#include "wx/image.h"
#endif
#include "wx/evtloop.h"
#include "wx/event.h"
#include "wx/app.h"
+#include "wx/window.h"
#ifdef __VMS__
#pragma message disable nosimpint
static void wxBreakDispatch()
{
- char dummy;
+ char dummy = 0; // for valgrind
// check if wxWakeUpIdle has already been called
fd_set in;
parentWidget,
XmNarrowDirection, arrow_dir,
XmNborderWidth, 0,
+ XmNshadowThickness, 0,
NULL );
XtAddCallback( (Widget) m_mainWidget,
wxSize wxSpinButton::DoGetBestSize() const
{
- return IsVertical() ? wxSize( 24, 34 ) : wxSize( 34, 24 );
+ return IsVertical() ? wxSize( 20, 30 ) : wxSize( 30, 20 );
}
// Attributes