X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c78e7c70271608b076b1dbed201b1204e6898d4..117247fd2cf664fc7b86b3101246a3a58332898a:/src/qt/radiobox.cpp diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 758e70f76e..a3ecae6d01 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -1,133 +1,192 @@ ///////////////////////////////////////////////////////////////////////////// // Name: radiobox.cpp -// Purpose: -// Author: Robert Roebling -// Created: 01/02/97 -// Id: -// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem +// Purpose: wxRadioBox +// Author: AUTHOR +// Modified by: +// Created: ??/??/98 +// RCS-ID: $Id$ +// Copyright: (c) AUTHOR // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - #ifdef __GNUG__ #pragma implementation "radiobox.h" #endif #include "wx/radiobox.h" -#include "wx/dialog.h" -#include "wx/frame.h" -//----------------------------------------------------------------------------- -// data -//----------------------------------------------------------------------------- +IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) -extern bool g_blockEventsOnDrag; +// Radio box item +wxRadioBox::wxRadioBox() +{ + m_selectedButton = -1; + m_noItems = 0; + m_noRowsOrCols = 0; + m_majorDim = 0 ; +} -//----------------------------------------------------------------------------- +bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, + const wxPoint& pos, const wxSize& size, + int n, const wxString choices[], + int majorDim, long style, + const wxValidator& val, const wxString& name) +{ + m_selectedButton = -1; + m_noItems = n; -IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl) + SetName(name); + SetValidator(val); -wxRadioBox::wxRadioBox(void) -{ -}; + parent->AddChild(this); + + m_windowStyle = (long&)style; + + if (id == -1) + m_windowId = NewControlId(); + else + m_windowId = id; + + m_noRowsOrCols = majorDim; -wxRadioBox::wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint &pos, const wxSize &size, - int n, const wxString choices[], - int majorDim, long style, - const wxString &name ) + if (majorDim==0) + m_majorDim = n ; + else + m_majorDim = majorDim ; + + + // TODO create radiobox + return FALSE; +} + + +wxRadioBox::~wxRadioBox() { - Create( parent, id, title, pos, size, n, choices, majorDim, style, name ); -}; + // TODO +} -bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint &pos, const wxSize &size, - int n, const wxString choices[], - int WXUNUSED(majorDim), long style, - const wxString &name ) +wxString wxRadioBox::GetLabel(int item) const { - return TRUE; -}; + // TODO + return wxString(""); +} -bool wxRadioBox::Show( bool show ) +void wxRadioBox::SetLabel(int item, const wxString& label) { - wxWindow::Show( show ); - return TRUE; -}; + // TODO +} -int wxRadioBox::FindString( const wxString &s ) const +int wxRadioBox::FindString(const wxString& s) const { - return -1; -}; + // TODO + return -1; +} -void wxRadioBox::SetSelection( int n ) +void wxRadioBox::SetSelection(int n) { -}; + if ((n < 0) || (n >= m_noItems)) + return; + // TODO -int wxRadioBox::GetSelection(void) const + m_selectedButton = n; +} + +// Get single selection, for single choice list items +int wxRadioBox::GetSelection() const { - return -1; -}; + return m_selectedButton; +} -wxString wxRadioBox::GetString( int n ) const +// Find string for position +wxString wxRadioBox::GetString(int n) const { -}; + // TODO + return wxString(""); +} -wxString wxRadioBox::GetLabel(void) const +void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags) { - return wxControl::GetLabel(); -}; + // TODO +} -void wxRadioBox::SetLabel( const wxString& WXUNUSED(label) ) +void wxRadioBox::GetSize(int *width, int *height) const { -}; + // TODO +} -void wxRadioBox::SetLabel( int WXUNUSED(item), const wxString& WXUNUSED(label) ) +void wxRadioBox::GetPosition(int *x, int *y) const { -}; + // TODO +} -void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) ) +wxString wxRadioBox::GetLabel() const { -}; + // TODO + return wxString(""); +} -wxString wxRadioBox::GetLabel( int WXUNUSED(item) ) const +void wxRadioBox::SetLabel(const wxString& label) { - return ""; -}; + // TODO +} -void wxRadioBox::Enable( bool WXUNUSED(enable) ) +void wxRadioBox::SetFocus() { -}; + // TODO +} -void wxRadioBox::Enable( int WXUNUSED(item), bool WXUNUSED(enable) ) +bool wxRadioBox::Show(bool show) { -}; + // TODO + return FALSE; +} -void wxRadioBox::Show( int WXUNUSED(item), bool WXUNUSED(show) ) +// Enable a specific button +void wxRadioBox::Enable(int item, bool enable) { -}; + // TODO +} -wxString wxRadioBox::GetStringSelection(void) const +// Enable all controls +void wxRadioBox::Enable(bool enable) { - return ""; -}; + wxControl::Enable(enable); + + // TODO +} -bool wxRadioBox::SetStringSelection( const wxString&s ) +// Show a specific button +void wxRadioBox::Show(int item, bool show) { - return TRUE; -}; + // TODO +} -int wxRadioBox::Number(void) const +// For single selection items only +wxString wxRadioBox::GetStringSelection () const { - return 0; -}; + int sel = GetSelection (); + if (sel > -1) + return this->GetString (sel); + else + return wxString(""); +} -int wxRadioBox::GetNumberOfRowsOrCols(void) const +bool wxRadioBox::SetStringSelection (const wxString& s) { - return 1; -}; + int sel = FindString (s); + if (sel > -1) + { + SetSelection (sel); + return TRUE; + } + else + return FALSE; +} -void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) ) +void wxRadioBox::Command (wxCommandEvent & event) { -}; + SetSelection (event.m_commandInt); + ProcessCommand (event); +} +