Various other tweaks and updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12397 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-11-13 03:18:00 +00:00
parent 25b00b4e8c
commit 98624b49d3
10 changed files with 1007 additions and 892 deletions

View File

@@ -6,7 +6,7 @@ from wxPython.wx import *
def runTest(frame, nb, log):
dlg = wxSingleChoiceDialog(frame, 'Test Single Choice', 'The Caption',
['zero', 'one', 'two', 'three', 'four', 'five',
'six', 'seven', 'eight'])
'six', 'seven', 'eight'], wxOK|wxCANCEL)
if dlg.ShowModal() == wxID_OK:
log.WriteText('You selected: %s\n' % dlg.GetStringSelection())
dlg.Destroy()

View File

@@ -0,0 +1,2 @@
build
dist

View File

@@ -19,7 +19,7 @@ and much more.
this command to build the .exe and collect the
other needed files:
python setup.py py2exe
python setup.py py2exe -w
superdoodle.iss An InnoSetup script to build a self-installer of

View File

@@ -520,6 +520,9 @@ public:
const wxColour& GetTextColour() const;
const wxColour& GetBackgroundColour() const;
const wxFont& GetFont() const;
// returns false if we have any attributes set, true otherwise
bool IsDefault();
};
@@ -544,48 +547,80 @@ public:
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
%pragma(python) addtomethod = "wxPreTextCtrl:val._setOORInfo(val)"
void Clear();
void Copy();
void Cut();
void DiscardEdits();
long GetInsertionPoint();
long GetLastPosition();
int GetLineLength(long lineNo);
wxString GetLineText(long lineNo);
int GetNumberOfLines();
wxString GetValue();
bool IsModified();
bool LoadFile(const wxString& filename);
void Paste();
void PositionToXY(long pos, long *OUTPUT, long *OUTPUT);
void Remove(long from, long to);
void Replace(long from, long to, const wxString& value);
bool SaveFile(const wxString& filename);
void SetEditable(bool editable);
void SetInsertionPoint(long pos);
void SetInsertionPointEnd();
void SetSelection(long from, long to);
wxString GetValue() const;
void SetValue(const wxString& value);
void ShowPosition(long pos);
int GetLineLength(long lineNo) const;
wxString GetLineText(long lineNo) const;
int GetNumberOfLines() const;
bool IsModified() const;
bool IsEditable() const;
// If the return values from and to are the same, there is no selection.
void GetSelection(long* OUTPUT, long* OUTPUT) const;
void Clear();
void Replace(long from, long to, const wxString& value);
void Remove(long from, long to);
// load/save the controls contents from/to the file
bool LoadFile(const wxString& file);
bool SaveFile(const wxString& file = wxEmptyString);
// clears the dirty flag
void DiscardEdits();
// set the max number of characters which may be entered in a single line
// text control
void SetMaxLength(unsigned long len);
// writing text inserts it at the current position, appending always
// inserts it at the end
void WriteText(const wxString& text);
void AppendText(const wxString& text);
long XYToPosition(long x, long y);
bool CanCopy();
bool CanCut();
bool CanPaste();
bool CanRedo();
bool CanUndo();
void GetSelection(long* OUTPUT, long* OUTPUT);
bool IsEditable();
void Undo();
void Redo();
// text control under some platforms supports the text styles: these
// methods allow to apply the given text style to the given selection or to
// set/get the style which will be used for all appended text
bool SetStyle(long start, long end, const wxTextAttr& style);
bool SetDefaultStyle(const wxTextAttr& style);
const wxTextAttr& GetDefaultStyle() const;
void SetMaxLength(unsigned long len);
// translate between the position (which is just an index in the text ctrl
// considering all its contents as a single strings) and (x, y) coordinates
// which represent column and line.
long XYToPosition(long x, long y) const;
bool PositionToXY(long pos, long *OUTPUT, long *OUTPUT) const;
void ShowPosition(long pos);
// Clipboard operations
void Copy();
void Cut();
void Paste();
bool CanCopy() const;
bool CanCut() const;
bool CanPaste() const;
// Undo/redo
void Undo();
void Redo();
bool CanUndo() const;
bool CanRedo() const;
// Insertion point
void SetInsertionPoint(long pos);
void SetInsertionPointEnd();
long GetInsertionPoint() const;
long GetLastPosition() const;
void SetSelection(long from, long to);
void SelectAll();
void SetEditable(bool editable);
%addmethods {
void write(const wxString& text) {

View File

@@ -362,6 +362,10 @@ enum wxFontEncoding
wxFONTENCODING_CP866, // and another one
// and for Windows
wxFONTENCODING_CP874, // WinThai
wxFONTENCODING_CP932, // Japanese (shift-JIS)
wxFONTENCODING_CP936, // Chiniese simplified (GB)
wxFONTENCODING_CP949, // Korean (Hangul charset)
wxFONTENCODING_CP950, // Chinese (traditional - Big5)
wxFONTENCODING_CP1250, // WinLatin2
wxFONTENCODING_CP1251, // WinCyrillic
wxFONTENCODING_CP1252, // WinLatin1

File diff suppressed because it is too large Load Diff

View File

@@ -591,6 +591,9 @@ class wxTextAttrPtr :
val = apply(controlsc.wxTextAttr_GetFont,(self,) + _args, _kwargs)
if val: val = wxFontPtr(val)
return val
def IsDefault(self, *_args, **_kwargs):
val = apply(controlsc.wxTextAttr_IsDefault,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxTextAttr instance at %s>" % (self.this,)
class wxTextAttr(wxTextAttrPtr):
@@ -608,23 +611,11 @@ class wxTextCtrlPtr(wxControlPtr):
def Create(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Create,(self,) + _args, _kwargs)
return val
def Clear(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Clear,(self,) + _args, _kwargs)
def GetValue(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_GetValue,(self,) + _args, _kwargs)
return val
def Copy(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Copy,(self,) + _args, _kwargs)
return val
def Cut(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Cut,(self,) + _args, _kwargs)
return val
def DiscardEdits(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_DiscardEdits,(self,) + _args, _kwargs)
return val
def GetInsertionPoint(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_GetInsertionPoint,(self,) + _args, _kwargs)
return val
def GetLastPosition(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_GetLastPosition,(self,) + _args, _kwargs)
def SetValue(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetValue,(self,) + _args, _kwargs)
return val
def GetLineLength(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_GetLineLength,(self,) + _args, _kwargs)
@@ -635,47 +626,35 @@ class wxTextCtrlPtr(wxControlPtr):
def GetNumberOfLines(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_GetNumberOfLines,(self,) + _args, _kwargs)
return val
def GetValue(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_GetValue,(self,) + _args, _kwargs)
return val
def IsModified(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_IsModified,(self,) + _args, _kwargs)
return val
def LoadFile(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_LoadFile,(self,) + _args, _kwargs)
def IsEditable(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_IsEditable,(self,) + _args, _kwargs)
return val
def Paste(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Paste,(self,) + _args, _kwargs)
def GetSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_GetSelection,(self,) + _args, _kwargs)
return val
def PositionToXY(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_PositionToXY,(self,) + _args, _kwargs)
return val
def Remove(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Remove,(self,) + _args, _kwargs)
def Clear(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Clear,(self,) + _args, _kwargs)
return val
def Replace(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Replace,(self,) + _args, _kwargs)
return val
def Remove(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Remove,(self,) + _args, _kwargs)
return val
def LoadFile(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_LoadFile,(self,) + _args, _kwargs)
return val
def SaveFile(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SaveFile,(self,) + _args, _kwargs)
return val
def SetEditable(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetEditable,(self,) + _args, _kwargs)
def DiscardEdits(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_DiscardEdits,(self,) + _args, _kwargs)
return val
def SetInsertionPoint(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetInsertionPoint,(self,) + _args, _kwargs)
return val
def SetInsertionPointEnd(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetInsertionPointEnd,(self,) + _args, _kwargs)
return val
def SetSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetSelection,(self,) + _args, _kwargs)
return val
def SetValue(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetValue,(self,) + _args, _kwargs)
return val
def ShowPosition(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_ShowPosition,(self,) + _args, _kwargs)
def SetMaxLength(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetMaxLength,(self,) + _args, _kwargs)
return val
def WriteText(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_WriteText,(self,) + _args, _kwargs)
@@ -683,36 +662,6 @@ class wxTextCtrlPtr(wxControlPtr):
def AppendText(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_AppendText,(self,) + _args, _kwargs)
return val
def XYToPosition(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_XYToPosition,(self,) + _args, _kwargs)
return val
def CanCopy(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_CanCopy,(self,) + _args, _kwargs)
return val
def CanCut(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_CanCut,(self,) + _args, _kwargs)
return val
def CanPaste(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_CanPaste,(self,) + _args, _kwargs)
return val
def CanRedo(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_CanRedo,(self,) + _args, _kwargs)
return val
def CanUndo(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_CanUndo,(self,) + _args, _kwargs)
return val
def GetSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_GetSelection,(self,) + _args, _kwargs)
return val
def IsEditable(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_IsEditable,(self,) + _args, _kwargs)
return val
def Undo(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Undo,(self,) + _args, _kwargs)
return val
def Redo(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Redo,(self,) + _args, _kwargs)
return val
def SetStyle(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetStyle,(self,) + _args, _kwargs)
return val
@@ -723,8 +672,65 @@ class wxTextCtrlPtr(wxControlPtr):
val = apply(controlsc.wxTextCtrl_GetDefaultStyle,(self,) + _args, _kwargs)
if val: val = wxTextAttrPtr(val)
return val
def SetMaxLength(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetMaxLength,(self,) + _args, _kwargs)
def XYToPosition(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_XYToPosition,(self,) + _args, _kwargs)
return val
def PositionToXY(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_PositionToXY,(self,) + _args, _kwargs)
return val
def ShowPosition(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_ShowPosition,(self,) + _args, _kwargs)
return val
def Copy(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Copy,(self,) + _args, _kwargs)
return val
def Cut(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Cut,(self,) + _args, _kwargs)
return val
def Paste(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Paste,(self,) + _args, _kwargs)
return val
def CanCopy(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_CanCopy,(self,) + _args, _kwargs)
return val
def CanCut(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_CanCut,(self,) + _args, _kwargs)
return val
def CanPaste(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_CanPaste,(self,) + _args, _kwargs)
return val
def Undo(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Undo,(self,) + _args, _kwargs)
return val
def Redo(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_Redo,(self,) + _args, _kwargs)
return val
def CanUndo(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_CanUndo,(self,) + _args, _kwargs)
return val
def CanRedo(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_CanRedo,(self,) + _args, _kwargs)
return val
def SetInsertionPoint(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetInsertionPoint,(self,) + _args, _kwargs)
return val
def SetInsertionPointEnd(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetInsertionPointEnd,(self,) + _args, _kwargs)
return val
def GetInsertionPoint(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_GetInsertionPoint,(self,) + _args, _kwargs)
return val
def GetLastPosition(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_GetLastPosition,(self,) + _args, _kwargs)
return val
def SetSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetSelection,(self,) + _args, _kwargs)
return val
def SelectAll(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SelectAll,(self,) + _args, _kwargs)
return val
def SetEditable(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_SetEditable,(self,) + _args, _kwargs)
return val
def write(self, *_args, **_kwargs):
val = apply(controlsc.wxTextCtrl_write,(self,) + _args, _kwargs)

View File

@@ -12661,6 +12661,10 @@ SWIGEXPORT(void) initgdic() {
PyDict_SetItemString(d,"wxFONTENCODING_CP855", PyInt_FromLong((long) wxFONTENCODING_CP855));
PyDict_SetItemString(d,"wxFONTENCODING_CP866", PyInt_FromLong((long) wxFONTENCODING_CP866));
PyDict_SetItemString(d,"wxFONTENCODING_CP874", PyInt_FromLong((long) wxFONTENCODING_CP874));
PyDict_SetItemString(d,"wxFONTENCODING_CP932", PyInt_FromLong((long) wxFONTENCODING_CP932));
PyDict_SetItemString(d,"wxFONTENCODING_CP936", PyInt_FromLong((long) wxFONTENCODING_CP936));
PyDict_SetItemString(d,"wxFONTENCODING_CP949", PyInt_FromLong((long) wxFONTENCODING_CP949));
PyDict_SetItemString(d,"wxFONTENCODING_CP950", PyInt_FromLong((long) wxFONTENCODING_CP950));
PyDict_SetItemString(d,"wxFONTENCODING_CP1250", PyInt_FromLong((long) wxFONTENCODING_CP1250));
PyDict_SetItemString(d,"wxFONTENCODING_CP1251", PyInt_FromLong((long) wxFONTENCODING_CP1251));
PyDict_SetItemString(d,"wxFONTENCODING_CP1252", PyInt_FromLong((long) wxFONTENCODING_CP1252));

View File

@@ -1390,6 +1390,10 @@ wxFONTENCODING_CP852 = gdic.wxFONTENCODING_CP852
wxFONTENCODING_CP855 = gdic.wxFONTENCODING_CP855
wxFONTENCODING_CP866 = gdic.wxFONTENCODING_CP866
wxFONTENCODING_CP874 = gdic.wxFONTENCODING_CP874
wxFONTENCODING_CP932 = gdic.wxFONTENCODING_CP932
wxFONTENCODING_CP936 = gdic.wxFONTENCODING_CP936
wxFONTENCODING_CP949 = gdic.wxFONTENCODING_CP949
wxFONTENCODING_CP950 = gdic.wxFONTENCODING_CP950
wxFONTENCODING_CP1250 = gdic.wxFONTENCODING_CP1250
wxFONTENCODING_CP1251 = gdic.wxFONTENCODING_CP1251
wxFONTENCODING_CP1252 = gdic.wxFONTENCODING_CP1252

View File

@@ -219,6 +219,7 @@ public:
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
// the point must be given in screen coordinates!
void Position(const wxPoint& ptOrigin,
const wxSize& size);
};