Added wxGenericValidator & doc
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1635 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -143,7 +143,7 @@ These classes are related to drawing on device contexts and windows.
|
||||
\twocolitem{\helpref{wxFont}{wxfont}}{Represents fonts}
|
||||
\twocolitem{\helpref{wxFontList}{wxfontlist}}{The list of previously-created fonts}
|
||||
\twocolitem{\helpref{wxIcon}{wxicon}}{A small, transparent bitmap for assigning to frames and drawing on device contexts}
|
||||
\twocolitem{\helpref{wxImage}{wximage}}{A platform-independent image class.}
|
||||
\twocolitem{\helpref{wxImage}{wximage}}{A platform-independent image class}
|
||||
\twocolitem{\helpref{wxImageList}{wximagelist}}{A list of images, used with some controls}
|
||||
\twocolitem{\helpref{wxMask}{wxmask}}{Represents a mask to be used with a bitmap for transparent drawing}
|
||||
\twocolitem{\helpref{wxPen}{wxpen}}{Used for drawing lines on a device context}
|
||||
@@ -196,8 +196,9 @@ These are the window validators, used for filtering and validating
|
||||
user input.
|
||||
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{\helpref{wxValidator}{wxvalidator}}{Base validator class.}
|
||||
\twocolitem{\helpref{wxTextValidator}{wxtextvalidator}}{Text control validator class.}
|
||||
\twocolitem{\helpref{wxValidator}{wxvalidator}}{Base validator class}
|
||||
\twocolitem{\helpref{wxTextValidator}{wxtextvalidator}}{Text control validator class}
|
||||
\twocolitem{\helpref{wxGenericValidator}{wxgenericvalidator}}{Generic control validator class}
|
||||
\end{twocollist}
|
||||
|
||||
{\large {\bf Data structures}}
|
||||
@@ -222,7 +223,7 @@ These are the data structure classes supported by wxWindows.
|
||||
\twocolitem{\helpref{wxSize}{wxsize}}{Representation of a size}
|
||||
\twocolitem{\helpref{wxTime}{wxtime}}{A class for time manipulation}
|
||||
\twocolitem{\helpref{wxVariant}{wxvariant}}{A class for storing arbitrary types
|
||||
that may change at run-time.}
|
||||
that may change at run-time}
|
||||
\end{twocollist}
|
||||
|
||||
{\large {\bf Run-time class information system}}
|
||||
|
@@ -100,6 +100,7 @@ $$\image{14cm;0cm}{wxclass.ps}$$
|
||||
\input ftp.tex
|
||||
\input gauge.tex
|
||||
\input gdiobj.tex
|
||||
\input valgen.tex
|
||||
\input grid.tex
|
||||
\input hash.tex
|
||||
\input helpinst.tex
|
||||
|
@@ -1,7 +1,7 @@
|
||||
% -----------------------------------------------------------------------------
|
||||
% wxSocketInputStream
|
||||
% -----------------------------------------------------------------------------
|
||||
\section{\class{wxSocketInputStream}}
|
||||
\section{\class{wxSocketInputStream}}\label{wxsocketinputstream}
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
@@ -23,7 +23,7 @@ socket connection.
|
||||
% -----------------------------------------------------------------------------
|
||||
% wxSocketOutputStream
|
||||
% -----------------------------------------------------------------------------
|
||||
\section{\class{wxSocketInputStream}}
|
||||
\section{\class{wxSocketOutputStream}}\label{wxsocketoutputstream}
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
|
81
docs/latex/wx/valgen.tex
Normal file
81
docs/latex/wx/valgen.tex
Normal file
@@ -0,0 +1,81 @@
|
||||
\section{\class{wxGenericValidator}}\label{wxgenericvalidator}
|
||||
|
||||
wxGenericValidator performs data transfer (but not validation or filtering) for the following
|
||||
basic controls: wxButton, wxCheckBox, wxListBox, wxStaticText, wxRadioButton, wxRadioBox,
|
||||
wxChoice, wxComboBox, wxGauge, wxSlider, wxScrollBar, wxSpinButton, wxTextCtrl, wxCheckListBox.
|
||||
|
||||
It checks the type of the window and uses an appropriate type for that window. For example,
|
||||
wxButton and wxTextCtrl transfer data to and from a wxString variable; wxListBox uses a
|
||||
wxArrayInt; wxCheckBox uses a bool.
|
||||
|
||||
For more information, please see \helpref{Validator overview}{validatoroverview}.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxValidator}{wxvalidator}\\
|
||||
\helpref{wxEvtHandler}{wxevthandler}\\
|
||||
\helpref{wxObject}{wxobject}
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Validator overview}{validatoroverview}, \helpref{wxValidator}{wxvalidator},
|
||||
\helpref{wxTextValidator}{wxTextvalidator}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
\membersection{wxGenericValidator::wxGenericValidator}\label{wxgenericvalidatorconstr}
|
||||
|
||||
\func{}{wxGenericValidator}{\param{const wxGenericValidator\&}{ validator}}
|
||||
|
||||
Copy constructor.
|
||||
|
||||
\func{}{wxGenericValidator}{\param{bool*}{ valPtr}}
|
||||
|
||||
Constructor taking a bool pointer. This will be used for wxCheckBox and wxRadioButton.
|
||||
|
||||
\func{}{wxGenericValidator}{\param{wxString*}{ valPtr}}
|
||||
|
||||
Constructor taking a wxString pointer. This will be used for wxButton, wxComboBox, wxStaticText,
|
||||
wxTextCtrl.
|
||||
|
||||
\func{}{wxGenericValidator}{\param{int*}{ valPtr}}
|
||||
|
||||
Constructor taking an integer pointer. This will be used for wxGauge, wxScrollBar, wxRadioBox, wxSpinButton,
|
||||
wxChoice.
|
||||
|
||||
\func{}{wxGenericValidator}{\param{wxArrayInt*}{ valPtr}}
|
||||
|
||||
Constructor taking a wxArrayInt pointer. This will be used for wxListBox, wxCheckListBox.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{validator}{Validator to copy.}
|
||||
|
||||
\docparam{valPtr}{A pointer to a variable that contains the value. This variable
|
||||
should have a lifetime equal to or longer than the validator lifetime (which is usually
|
||||
determined by the lifetime of the window).}
|
||||
|
||||
\membersection{wxGenericValidator::\destruct{wxGenericValidator}}
|
||||
|
||||
\func{}{\destruct{wxGenericValidator}}{\void}
|
||||
|
||||
Destructor.
|
||||
|
||||
\membersection{wxGenericValidator::Clone}\label{wxgenericvalidatorclone}
|
||||
|
||||
\constfunc{virtual wxValidator*}{Clone}{\void}
|
||||
|
||||
Clones the generic validator using the copy constructor.
|
||||
|
||||
\membersection{wxGenericValidator::TransferFromWindow}\label{wxgenericvalidatortransferfromwindow}
|
||||
|
||||
\func{virtual bool}{TransferToWindow}{\param{wxWindow*}{ parent}}
|
||||
|
||||
Transfers the value to the window.
|
||||
|
||||
\membersection{wxGenericValidator::TransferToWindow}\label{wxgenericvalidatortransfertowindow}
|
||||
|
||||
\func{virtual bool}{TransferToWindow}{\param{wxWindow*}{ parent}}
|
||||
|
||||
Transfers the window value to the appropriate data type.
|
||||
|
@@ -12,7 +12,8 @@ For more information, please see \helpref{Validator overview}{validatoroverview}
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{Validator overview}{validatoroverview}, \helpref{wxValidator}{wxvalidator}
|
||||
\helpref{Validator overview}{validatoroverview}, \helpref{wxValidator}{wxvalidator},
|
||||
\helpref{wxGenericValidator}{wxgenericvalidator}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
@@ -57,7 +58,7 @@ Destructor.
|
||||
|
||||
\membersection{wxTextValidator::Clone}\label{wxtextvalidatorclone}
|
||||
|
||||
\constfunc{virtual wxTextValidator*}{Clone}{\void}
|
||||
\constfunc{virtual wxValidator*}{Clone}{\void}
|
||||
|
||||
Clones the text validator using the copy constructor.
|
||||
|
||||
|
@@ -22,6 +22,10 @@
|
||||
typedef void WXIDISPATCH;
|
||||
typedef unsigned short* WXBSTR;
|
||||
|
||||
#ifdef GetObject
|
||||
#undef GetObject
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wxAutomationObject
|
||||
* Wraps up an IDispatch pointer and invocation; does variant conversion.
|
||||
|
58
include/wx/valgen.h
Normal file
58
include/wx/valgen.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: valgen.h
|
||||
// Purpose: wxGenericValidator class
|
||||
// Author: Kevin Smith
|
||||
// Modified by:
|
||||
// Created: Jan 22 1999
|
||||
// RCS-ID:
|
||||
// Copyright: (c) 1999 Kevin Smith
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_VALGENH__
|
||||
#define _WX_VALGENH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "valgen.h"
|
||||
#endif
|
||||
|
||||
#include "wx/validate.h"
|
||||
|
||||
class WXDLLEXPORT wxGenericValidator: public wxValidator
|
||||
{
|
||||
public:
|
||||
wxGenericValidator(bool* val);
|
||||
wxGenericValidator(int* val);
|
||||
wxGenericValidator(wxString* val);
|
||||
wxGenericValidator(wxArrayInt* val);
|
||||
wxGenericValidator(const wxGenericValidator& copyFrom);
|
||||
|
||||
~wxGenericValidator();
|
||||
|
||||
// Make a clone of this validator (or return NULL) - currently necessary
|
||||
// if you're passing a reference to a validator.
|
||||
// Another possibility is to always pass a pointer to a new validator
|
||||
// (so the calling code can use a copy constructor of the relevant class).
|
||||
virtual wxValidator *Clone(void) const { return new wxGenericValidator(*this); }
|
||||
bool Copy(const wxGenericValidator& val);
|
||||
|
||||
// Called when the value in the window must be validated.
|
||||
// This function can pop up an error message.
|
||||
virtual bool Validate(wxWindow *parent) {return true;}
|
||||
|
||||
// Called to transfer data to the window
|
||||
virtual bool TransferToWindow(void);
|
||||
|
||||
// Called to transfer data to the window
|
||||
virtual bool TransferFromWindow(void);
|
||||
|
||||
protected:
|
||||
void Initialize();
|
||||
|
||||
bool* m_pBool;
|
||||
int* m_pInt;
|
||||
wxString* m_pString;
|
||||
wxArrayInt* m_pArrayInt;
|
||||
};
|
||||
|
||||
#endif // _WX_VALGENH__
|
386
src/common/valgen.cpp
Normal file
386
src/common/valgen.cpp
Normal file
@@ -0,0 +1,386 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: valgen.cpp
|
||||
// Purpose: wxGenericValidator class
|
||||
// Author: Kevin Smith
|
||||
// Modified by:
|
||||
// Created: Jan 22 1999
|
||||
// RCS-ID:
|
||||
// Copyright: (c) 1999 Kevin Smith
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "valgen.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/spinbutt.h"
|
||||
#include "wx/checklst.h"
|
||||
|
||||
#include "wx/valgen.h"
|
||||
|
||||
wxGenericValidator::wxGenericValidator(bool *val)
|
||||
{
|
||||
Initialize();
|
||||
m_pBool = val;
|
||||
}
|
||||
|
||||
wxGenericValidator::wxGenericValidator(int *val)
|
||||
{
|
||||
Initialize();
|
||||
m_pInt = val;
|
||||
}
|
||||
|
||||
wxGenericValidator::wxGenericValidator(wxString *val)
|
||||
{
|
||||
Initialize();
|
||||
m_pString = val;
|
||||
}
|
||||
|
||||
wxGenericValidator::wxGenericValidator(wxArrayInt *val)
|
||||
{
|
||||
Initialize();
|
||||
m_pArrayInt = val;
|
||||
}
|
||||
|
||||
wxGenericValidator::wxGenericValidator(const wxGenericValidator& val)
|
||||
{
|
||||
Copy(val);
|
||||
}
|
||||
|
||||
bool wxGenericValidator::Copy(const wxGenericValidator& val)
|
||||
{
|
||||
wxValidator::Copy(val);
|
||||
|
||||
m_pBool = val.m_pBool;
|
||||
m_pInt = val.m_pInt;
|
||||
m_pString = val.m_pString;
|
||||
m_pArrayInt = val.m_pArrayInt;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxGenericValidator::~wxGenericValidator()
|
||||
{
|
||||
}
|
||||
|
||||
// Called to transfer data to the window
|
||||
bool wxGenericValidator::TransferToWindow(void)
|
||||
{
|
||||
if ( !m_validatorWindow )
|
||||
return FALSE;
|
||||
|
||||
// bool controls
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
|
||||
{
|
||||
wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
|
||||
if (m_pBool)
|
||||
{
|
||||
pControl->SetValue(*m_pBool) ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
|
||||
{
|
||||
wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
|
||||
if (m_pBool)
|
||||
{
|
||||
pControl->SetValue(*m_pBool) ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
// int controls
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
|
||||
{
|
||||
wxGauge* pControl = (wxGauge*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
pControl->SetValue(*m_pInt) ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
|
||||
{
|
||||
wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
pControl->SetSelection(*m_pInt) ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
|
||||
{
|
||||
wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
pControl->SetThumbPosition(*m_pInt) ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
|
||||
{
|
||||
wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
pControl->SetValue(*m_pInt) ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
// string controls
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
|
||||
{
|
||||
wxButton* pControl = (wxButton*) m_validatorWindow;
|
||||
if (m_pString)
|
||||
{
|
||||
pControl->SetLabel(*m_pString) ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
|
||||
{
|
||||
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
|
||||
if (m_pString)
|
||||
{
|
||||
pControl->SetValue(*m_pString) ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
|
||||
{
|
||||
wxChoice* pControl = (wxChoice*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
pControl->SetSelection(*m_pInt) ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
|
||||
{
|
||||
wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
|
||||
if (m_pString)
|
||||
{
|
||||
pControl->SetLabel(*m_pString) ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
|
||||
{
|
||||
wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
|
||||
if (m_pString)
|
||||
{
|
||||
pControl->SetValue(*m_pString) ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
// array controls
|
||||
// NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox
|
||||
// MUST come first:
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
|
||||
{
|
||||
wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
|
||||
if (m_pArrayInt)
|
||||
{
|
||||
// clear all selections
|
||||
int i;
|
||||
for (i = 0 ; i < pControl->Number(); ++i)
|
||||
pControl->Check(i, FALSE);
|
||||
// select each item in our array
|
||||
unsigned u;
|
||||
for (u = 0; u < m_pArrayInt->Count(); ++u)
|
||||
pControl->Check(m_pArrayInt->Item(u));
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
|
||||
{
|
||||
wxListBox* pControl = (wxListBox*) m_validatorWindow;
|
||||
if (m_pArrayInt)
|
||||
{
|
||||
// clear all selections
|
||||
int i;
|
||||
for (i = 0 ; i < pControl->Number(); ++i)
|
||||
pControl->Deselect(i);
|
||||
// select each item in our array
|
||||
unsigned u;
|
||||
for (u = 0; u < m_pArrayInt->Count(); ++u)
|
||||
pControl->SetSelection(m_pArrayInt->Item(u));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// unrecognized control, or bad pointer
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Called to transfer data to the window
|
||||
bool wxGenericValidator::TransferFromWindow(void)
|
||||
{
|
||||
if ( !m_validatorWindow )
|
||||
return FALSE;
|
||||
|
||||
// bool controls
|
||||
if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) )
|
||||
{
|
||||
wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow;
|
||||
if (m_pBool)
|
||||
{
|
||||
*m_pBool = pControl->GetValue() ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) )
|
||||
{
|
||||
wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow;
|
||||
if (m_pBool)
|
||||
{
|
||||
*m_pBool = pControl->GetValue() ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
// int controls
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) )
|
||||
{
|
||||
wxGauge* pControl = (wxGauge*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
*m_pInt = pControl->GetValue() ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) )
|
||||
{
|
||||
wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
*m_pInt = pControl->GetSelection() ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) )
|
||||
{
|
||||
wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
*m_pInt = pControl->GetThumbPosition() ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) )
|
||||
{
|
||||
wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
*m_pInt = pControl->GetValue() ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
// string controls
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) )
|
||||
{
|
||||
wxButton* pControl = (wxButton*) m_validatorWindow;
|
||||
if (m_pString)
|
||||
{
|
||||
*m_pString = pControl->GetLabel() ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) )
|
||||
{
|
||||
wxComboBox* pControl = (wxComboBox*) m_validatorWindow;
|
||||
if (m_pString)
|
||||
{
|
||||
*m_pString = pControl->GetValue() ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) )
|
||||
{
|
||||
wxChoice* pControl = (wxChoice*) m_validatorWindow;
|
||||
if (m_pInt)
|
||||
{
|
||||
*m_pInt = pControl->GetSelection() ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) )
|
||||
{
|
||||
wxStaticText* pControl = (wxStaticText*) m_validatorWindow;
|
||||
if (m_pString)
|
||||
{
|
||||
*m_pString = pControl->GetLabel() ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
|
||||
{
|
||||
wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow;
|
||||
if (m_pString)
|
||||
{
|
||||
*m_pString = pControl->GetValue() ;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
// array controls
|
||||
// NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox
|
||||
// MUST come first:
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) )
|
||||
{
|
||||
wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow;
|
||||
if (m_pArrayInt)
|
||||
{
|
||||
// clear our array
|
||||
m_pArrayInt->Clear();
|
||||
// add each selected item to our array
|
||||
int i;
|
||||
for (i = 0 ; i < pControl->Number(); ++i)
|
||||
if (pControl->IsChecked(i))
|
||||
m_pArrayInt->Add(i);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) )
|
||||
{
|
||||
wxListBox* pControl = (wxListBox*) m_validatorWindow;
|
||||
if (m_pArrayInt)
|
||||
{
|
||||
// clear our array
|
||||
m_pArrayInt->Clear();
|
||||
// add each selected item to our array
|
||||
int i;
|
||||
for (i = 0 ; i < pControl->Number(); ++i)
|
||||
if (pControl->Selected(i))
|
||||
m_pArrayInt->Add(i);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// unrecognized control, or bad pointer
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
Called by constructors to initialize ALL data members
|
||||
*/
|
||||
void wxGenericValidator::Initialize()
|
||||
{
|
||||
m_pBool = 0;
|
||||
m_pInt = 0;
|
||||
m_pString = 0;
|
||||
m_pArrayInt = 0;
|
||||
}
|
||||
|
@@ -54,6 +54,7 @@ LIB_CPP_SRC=\
|
||||
common/objstrm.cpp \
|
||||
common/sckstrm.cpp \
|
||||
common/validate.cpp \
|
||||
common/valgen.cpp \
|
||||
common/valtext.cpp \
|
||||
common/variant.cpp \
|
||||
common/socket.cpp \
|
||||
|
@@ -55,6 +55,7 @@ LIB_CPP_SRC=\
|
||||
common/objstrm.cpp \
|
||||
common/sckstrm.cpp \
|
||||
common/validate.cpp \
|
||||
common/valgen.cpp \
|
||||
common/valtext.cpp \
|
||||
common/variant.cpp \
|
||||
common/wxexpr.cpp \
|
||||
|
@@ -59,6 +59,7 @@ LIB_CPP_SRC=\
|
||||
../common/objstrm.cpp \
|
||||
../common/sckstrm.cpp \
|
||||
../common/validate.cpp \
|
||||
../common/valgen.cpp \
|
||||
../common/valtext.cpp \
|
||||
../common/variant.cpp \
|
||||
../common/wxexpr.cpp \
|
||||
|
@@ -127,6 +127,7 @@ COMMONOBJS = \
|
||||
$(MSWDIR)\timercmn.obj \
|
||||
$(MSWDIR)\utilscmn.obj \
|
||||
$(MSWDIR)\validate.obj \
|
||||
$(MSWDIR)\valgen.obj \
|
||||
$(MSWDIR)\valtext.obj \
|
||||
$(MSWDIR)\variant.obj \
|
||||
$(MSWDIR)\date.obj \
|
||||
@@ -539,6 +540,8 @@ $(MSWDIR)\utilscmn.obj: $(COMMDIR)\utilscmn.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\validate.obj: $(COMMDIR)\validate.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\valgen.obj: $(COMMDIR)\valtext.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\valtext.obj: $(COMMDIR)\valtext.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\date.obj: $(COMMDIR)\date.$(SRCSUFF)
|
||||
|
@@ -124,6 +124,7 @@ COMMONOBJS = \
|
||||
$(MSWDIR)\timercmn.obj \
|
||||
$(MSWDIR)\utilscmn.obj \
|
||||
$(MSWDIR)\validate.obj \
|
||||
$(MSWDIR)\valgen.obj \
|
||||
$(MSWDIR)\valtext.obj \
|
||||
$(MSWDIR)\variant.obj \
|
||||
$(MSWDIR)\date.obj \
|
||||
@@ -526,6 +527,8 @@ $(MSWDIR)\utilscmn.obj: $(COMMDIR)\utilscmn.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\validate.obj: $(COMMDIR)\validate.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\valgen.obj: $(COMMDIR)\valgen.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\valtext.obj: $(COMMDIR)\valtext.$(SRCSUFF)
|
||||
|
||||
$(MSWDIR)\date.obj: $(COMMDIR)\date.$(SRCSUFF)
|
||||
|
@@ -105,6 +105,7 @@ COMMONOBJS = \
|
||||
$(COMMDIR)\timercmn.obj \
|
||||
$(COMMDIR)\utilscmn.obj \
|
||||
$(COMMDIR)\validate.obj \
|
||||
$(COMMDIR)\valgen.obj \
|
||||
$(COMMDIR)\valtext.obj \
|
||||
$(COMMDIR)\date.obj \
|
||||
$(COMMDIR)\wxexpr.obj \
|
||||
@@ -833,6 +834,11 @@ $(COMMDIR)/validate.obj: $*.$(SRCSUFF)
|
||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
$(COMMDIR)/valgen.obj: $*.$(SRCSUFF)
|
||||
cl @<<
|
||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
$(COMMDIR)/valtext.obj: $*.$(SRCSUFF)
|
||||
cl @<<
|
||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||
|
@@ -111,6 +111,7 @@ COMMONOBJS = \
|
||||
$(COMMDIR)/timercmn.$(OBJSUFF) \
|
||||
$(COMMDIR)/utilscmn.$(OBJSUFF) \
|
||||
$(COMMDIR)/validate.$(OBJSUFF) \
|
||||
$(COMMDIR)/valgen.$(OBJSUFF) \
|
||||
$(COMMDIR)/valtext.$(OBJSUFF) \
|
||||
$(COMMDIR)/date.$(OBJSUFF) \
|
||||
$(COMMDIR)/wxexpr.$(OBJSUFF) \
|
||||
|
@@ -83,6 +83,7 @@ COMMONOBJS = \
|
||||
$(COMMDIR)\timercmn.obj \
|
||||
$(COMMDIR)\utilscmn.obj \
|
||||
$(COMMDIR)\validate.obj \
|
||||
$(COMMDIR)\valgen.obj \
|
||||
$(COMMDIR)\valtext.obj \
|
||||
$(COMMDIR)\date.obj \
|
||||
$(COMMDIR)\hash.obj \
|
||||
|
@@ -69,6 +69,7 @@ COMMONOBJS = cmndata.obj \
|
||||
timercmn.obj \
|
||||
utilscmn.obj \
|
||||
validate.obj \
|
||||
valgen.obj \
|
||||
valtext.obj \
|
||||
date.obj \
|
||||
hash.obj \
|
||||
@@ -598,6 +599,9 @@ utilscmn.obj: $(COMMDIR)\utilscmn.cpp
|
||||
validate.obj: $(COMMDIR)\validate.cpp
|
||||
$(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\validate.cpp /BINARY validate.obj
|
||||
|
||||
valgen.obj: $(COMMDIR)\valgen.cpp
|
||||
$(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\valgen.cpp /BINARY valgen.obj
|
||||
|
||||
valtext.obj: $(COMMDIR)\valtext.cpp
|
||||
$(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\valtext.cpp /BINARY valtext.obj
|
||||
|
||||
|
@@ -108,6 +108,7 @@ COMMONOBJS = \
|
||||
$(COMMDIR)/timercmn.$(OBJSUFF) \
|
||||
$(COMMDIR)/utilscmn.$(OBJSUFF) \
|
||||
$(COMMDIR)/validate.$(OBJSUFF) \
|
||||
$(COMMDIR)/valgen.$(OBJSUFF) \
|
||||
$(COMMDIR)/valtext.$(OBJSUFF) \
|
||||
$(COMMDIR)/date.$(OBJSUFF) \
|
||||
$(COMMDIR)/wxexpr.$(OBJSUFF) \
|
||||
|
@@ -112,6 +112,7 @@ COMMONOBJS = \
|
||||
$(COMMDIR)\timercmn.obj \
|
||||
$(COMMDIR)\utilscmn.obj \
|
||||
$(COMMDIR)\validate.obj \
|
||||
$(COMMDIR)\valgen.obj \
|
||||
$(COMMDIR)\valtext.obj \
|
||||
$(COMMDIR)\date.obj \
|
||||
$(COMMDIR)\hash.obj \
|
||||
@@ -927,6 +928,11 @@ $(COMMDIR)/validate.obj: $*.$(SRCSUFF)
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
||||
<<
|
||||
|
||||
$(COMMDIR)/valgen.obj: $*.$(SRCSUFF)
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
||||
<<
|
||||
|
||||
$(COMMDIR)/valtext.obj: $*.$(SRCSUFF)
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
||||
|
@@ -79,6 +79,7 @@ COMMONOBJS = cmndata.obj &
|
||||
timercmn.obj &
|
||||
utilscmn.obj &
|
||||
validate.obj &
|
||||
valgen.obj &
|
||||
valtext.obj &
|
||||
date.obj &
|
||||
hash.obj &
|
||||
@@ -610,6 +611,9 @@ utilscmn.obj: $(COMMDIR)\utilscmn.cpp
|
||||
validate.obj: $(COMMDIR)\validate.cpp
|
||||
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
|
||||
|
||||
valgen.obj: $(COMMDIR)\valgen.cpp
|
||||
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
|
||||
|
||||
valtext.obj: $(COMMDIR)\valtext.cpp
|
||||
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
|
||||
|
||||
|
@@ -52,6 +52,7 @@ LIB_CPP_SRC=\
|
||||
common/objstrm.cpp \
|
||||
common/sckstrm.cpp \
|
||||
common/validate.cpp \
|
||||
common/valgen.cpp \
|
||||
common/valtext.cpp \
|
||||
common/variant.cpp \
|
||||
common/wxexpr.cpp \
|
||||
|
@@ -57,6 +57,7 @@ LIB_CPP_SRC=\
|
||||
../common/objstrm.cpp \
|
||||
../common/sckstrm.cpp \
|
||||
../common/validate.cpp \
|
||||
../common/valgen.cpp \
|
||||
../common/valtext.cpp \
|
||||
../common/variant.cpp \
|
||||
../common/wxexpr.cpp \
|
||||
|
@@ -145,6 +145,7 @@ COMMONOBJS = \
|
||||
$(COMMDIR)\timercmn.obj \
|
||||
$(COMMDIR)\utilscmn.obj \
|
||||
$(COMMDIR)\validate.obj \
|
||||
$(COMMDIR)\valgen.obj \
|
||||
$(COMMDIR)\valtext.obj \
|
||||
$(COMMDIR)\date.obj \
|
||||
$(COMMDIR)\hash.obj \
|
||||
@@ -750,6 +751,11 @@ $(COMMDIR)/validate.obj: $*.$(SRCSUFF)
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
||||
<<
|
||||
|
||||
$(COMMDIR)/valgen.obj: $*.$(SRCSUFF)
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
||||
<<
|
||||
|
||||
$(COMMDIR)/valtext.obj: $*.$(SRCSUFF)
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
||||
|
@@ -23,8 +23,6 @@
|
||||
#include <wx/frame.h>
|
||||
#endif
|
||||
|
||||
#include "GL/gl.h"
|
||||
|
||||
#include "glcanvas.h"
|
||||
|
||||
/*
|
||||
|
@@ -18,6 +18,8 @@
|
||||
|
||||
#include <wx/scrolwin.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "gl/gl.h"
|
||||
|
||||
class wxGLContext: public wxObject
|
||||
|
Reference in New Issue
Block a user