[wxPython] wxPython 2.3.2 problem

Since I upgraded from 2.3.1 to 2.3.2, my custom folds have disappeared . I
am talking about wxStyledText control here.

I can still click on where the arrow should be and the folding will happen,
but the arrows are not there. I am making these myself for Fortran.

However for all other modes they still work. Any idea?

Apart from the AltGr-problem discussed the other day,
I just noticed that I can't close the PyCrust window
with Alt-F4. :frowning: That is, if I'm in the shell window.
Related problem I imagine...

···

--
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se

Yep. I didn't get my changes to Robin in time. The version of PyCrust in CVS
does not have this problem.

PyCrust CVS: PyCrust download | SourceForge.net

···

---
Patrick K. O'Brien
Orbtech.com - Your Source For Python Development Services
Phone: 314-963-3206

-----Original Message-----
From: wxpython-users-admin@lists.wxwindows.org
[mailto:wxpython-users-admin@lists.wxwindows.org]On Behalf Of Magnus
Lyckå
Sent: Thursday, December 13, 2001 12:03 PM
To: wxpython-users@lists.wxwindows.org
Subject: [wxPython] PyCrust eating Alt-F4

Apart from the AltGr-problem discussed the other day,
I just noticed that I can't close the PyCrust window
with Alt-F4. :frowning: That is, if I'm in the shell window.
Related problem I imagine...

--
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

I'm still (or again rather) trying to do some odd
things with wxGrids. I have some problems.

I can catch EVT_KEY_DOWN in the grid, but never seem
to be able to get any EVT_CHAR. I assume they land inside
the editor control. Is there a way of getting at them
outside the editor? I'd like to intercept the editing,
catch any key press and just put the corresponding
character in the cell with SetValue. I've tried to set
cells to read only, and DisableCellEditControl, but I
still don't seem to get char events in the grid.

These are small cells, with room for only one character,
and with normal editing you never see what you type
since it's scrolled out of sight as soon as you type.
The key code in the key down event is as you know not
complete...

The code has changed, but the illustrations at
http://www.thinkware.se/cgi-bin/thinki.cgi/WxPythonProblem
still describe my problem.

Alternatively, if I'm stuck with key down events: Is there
a way of asking wxPython or the OS what character I would
get from for instance Ctrl + Alt + "2"? (It's @ in my
keyboard, but maybe not in yours...)

I was thinking of using something like the selection
choices in the GridCustTable demo, but our one character
cells are only 15 pixels wide, and they need to be fairly
narrow.

Also, I'd be happy if I could get some explanation about
what really happend when I enter a cell in a grid and
start typing. I'd be happy if I could find a slightly
more human friendly description than grid.cpp and friends.

What events appear, and when? Who call whom when and why?
Can I intercept the two click (not double click) entry
into cell editing?

I tried to RTFM "wxGrid classes overview", but this time
the F was appropriate! :frowning:

A more complex example

Yet to be written

···

-------------------------------------------------
How the wxGrid classes relate to each other

Yet to be written

-------------------------------------------------
Keyboard and mouse actions

Yet to be written

...

All of the above...yet to be understood by me... :frowning:
I'm a python programmer, so I'm spoiled! I expect
programming to be more or less trivial! :wink:

Thanks in advance for any enlightenment you might
give me...

--
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se

IMHO you need custom grid editor which quits after first character. There is custom editor example in demo.py

HTH,
Niki Spahiev

In my wxGrid derived class, i've set the event handler:
EVT_GRID_EDITOR_CREATED(self,self.OnEditorCreated)
And i've wrote the method:
    def OnEditorCreated(self,event):
        event.GetControl().SetMaxLength(2)
        event.Skip()

You can restrict a wxTextCtrl maximum length with SetMaxLength().

Hope his help,
Frank

Magnus Lyckå wrote:

···

I'm still (or again rather) trying to do some odd
things with wxGrids. I have some problems.

I can catch EVT_KEY_DOWN in the grid, but never seem
to be able to get any EVT_CHAR. I assume they land inside
the editor control. Is there a way of getting at them
outside the editor? I'd like to intercept the editing,
catch any key press and just put the corresponding
character in the cell with SetValue. I've tried to set
cells to read only, and DisableCellEditControl, but I
still don't seem to get char events in the grid.

These are small cells, with room for only one character,
and with normal editing you never see what you type
since it's scrolled out of sight as soon as you type.
The key code in the key down event is as you know not
complete...

The code has changed, but the illustrations at
http://www.thinkware.se/cgi-bin/thinki.cgi/WxPythonProblem
still describe my problem.

Alternatively, if I'm stuck with key down events: Is there
a way of asking wxPython or the OS what character I would
get from for instance Ctrl + Alt + "2"? (It's @ in my
keyboard, but maybe not in yours...)

I was thinking of using something like the selection
choices in the GridCustTable demo, but our one character
cells are only 15 pixels wide, and they need to be fairly
narrow.

Also, I'd be happy if I could get some explanation about
what really happend when I enter a cell in a grid and
start typing. I'd be happy if I could find a slightly
more human friendly description than grid.cpp and friends.

What events appear, and when? Who call whom when and why?
Can I intercept the two click (not double click) entry
into cell editing?

I tried to RTFM "wxGrid classes overview", but this time
the F was appropriate! :frowning:

A more complex example

Yet to be written

-------------------------------------------------
How the wxGrid classes relate to each other

Yet to be written

-------------------------------------------------
Keyboard and mouse actions

Yet to be written

...

All of the above...yet to be understood by me... :frowning:
I'm a python programmer, so I'm spoiled! I expect
programming to be more or less trivial! :wink:

Thanks in advance for any enlightenment you might
give me...

--
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

Hi Hassan,

Since I upgraded from 2.3.1 to 2.3.2, my custom folds have disappeared . I
am talking about wxStyledText control here.

I can still click on where the arrow should be and the folding will

happen,

but the arrows are not there. I am making these myself for Fortran.

However for all other modes they still work. Any idea?

   Scintilla can now provide a folding column that looks like a flattened
tree control using several extra images for subordinate lines and return
points. If you are setting up your own images you may have to check that you
are doing this OK. Probably best to post your STC initialisation code.

BTW:
   In the wxStyledTextCtrl_2 demo code, there is a comment:
        #self.SetFoldFlags(16) ### WHAT IS THIS VALUE? WHAT ARE THE OTHER
FLAGS? DOES IT MATTER?

   It is undocumented. Mostly they are for debugging but they also set up
the extra horizontal line that can appear above or below headers. Maybe one
day this will be cleaned up.

   Neil

Frank Jacques wrote:
> You can restrict a wxTextCtrl maximum length with SetMaxLength()
Aha! Excellent! That's new for 2.3.2 it
seems. Didn't see that before. And I get
an wxEVT_COMMAND_TEXT_MAXLEN event to
handle my full cell with. Now I'm starting
to like wxPython better again! That's the
right place for that check!

I guess I should also select the previous
text in BeginEdit, so that I will replace
it. (As in GridCustDemo.)

Niki's tips were also helpful in understanding
this a bit better, but I'm still pretty
confused about the whole grid behaviour
though. And it certainly seems overly
complex. Why does the behaviour of cells
in grids have to have so many layers of
behaviour on top of each other?

When you work with grids you might have
to code in the grid, in a cell renderer,
in a cell editor, in a text control and
in a validator. And some validators
(wxGenericValidator) has nothing to do
with validation, only with data transfer
for dialogs? And to get right aligned text
you need a subclass of wxTextCtrl... Is it
only me, or does this seem like a bit of a
patchwork?

/Magnus

···

--
Magnus Lyckå, Thinkware AB
Älvans väg 99, SE-907 50 UMEÅ
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se

I downloaded wxpython 2.3.1 source and did "python setup.py install". I get
the below message. I have already compiled wxwindows using Borland C++ 5.5.

Could someone help?

Thanks,
Jayesh

C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD
/W3
/GX -DWIN32 -D__WIN32__ -D_WINDOWS -D__WINDOWS__ -DWINVER=0x0400 -D__WIN95__
-DS
TRICT -D__WXMSW__ -DWXUSINGDLL=1 -DSWIG_GLOBAL -DHAVE_CONFIG_H -DWXP_USE_THR
EAD=
1 -Isrc -IC:\WX2\lib\mswdll -IC:\WX2\include -IC:\PYTHON21\Include
/TpC:\wxPytho
n-2.3.2\src\helpers.cpp /Fobuild\temp.win32-2.1\Release\src/helpers.obj
helpers.cpp
C:\wxPython-2.3.2\src\helpers.cpp(297) : error C2039: 'GetClientObject' : is
not
a member of 'wxEvtHandler'
        C:\WX2\include\wx/event.h(1467) : see declaration of 'wxEvtHandler'
C:\wxPython-2.3.2\src\helpers.cpp(318) : error C2039: 'SetClientObject' : is
not
a member of 'wxEvtHandler'
        C:\WX2\include\wx/event.h(1467) : see declaration of 'wxEvtHandler'
C:\wxPython-2.3.2\src\helpers.cpp(341) : error C2039: 'GetClientObject' : is
not
a member of 'wxSizer'
        C:\WX2\include\wx/sizer.h(129) : see declaration of 'wxSizer'
C:\wxPython-2.3.2\src\helpers.cpp(350) : error C2039: 'SetClientObject' : is
not
a member of 'wxSizer'
        C:\WX2\include\wx/sizer.h(129) : see declaration of 'wxSizer'
error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe"'
fail
ed with exit status 2

I downloaded wxpython 2.3.1 source and did "python setup.py install". I

get

the below message. I have already compiled wxwindows using Borland C++

5.5.

Could someone help?

Thanks,
Jayesh

C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox

/MD

/W3

/GX -DWIN32 -D__WIN32__ -D_WINDOWS -D__WINDOWS__ -DWINVER=0x0400 -D__WIN95__

-DS

TRICT -D__WXMSW__ -DWXUSINGDLL=1 -DSWIG_GLOBAL -DHAVE_CONFIG_H -DWXP_USE_THR

EAD=
1 -Isrc -IC:\WX2\lib\mswdll -IC:\WX2\include -IC:\PYTHON21\Include
/TpC:\wxPytho
n-2.3.2\src\helpers.cpp /Fobuild\temp.win32-2.1\Release\src/helpers.obj
helpers.cpp
C:\wxPython-2.3.2\src\helpers.cpp(297) : error C2039: 'GetClientObject' :

is

not
a member of 'wxEvtHandler'

You need to use the same version of wxWindows as wxPython. My guess is that
you have wxWindows 2.3.1 and wxPython 2.3.2? Also, I'll bet that you need
to use the same compiler on both as well.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

        C:\WX2\include\wx/event.h(1467) : see declaration of

'wxEvtHandler'

C:\wxPython-2.3.2\src\helpers.cpp(318) : error C2039: 'SetClientObject' :

is

not
a member of 'wxEvtHandler'
        C:\WX2\include\wx/event.h(1467) : see declaration of

'wxEvtHandler'

C:\wxPython-2.3.2\src\helpers.cpp(341) : error C2039: 'GetClientObject' :

is

not
a member of 'wxSizer'
        C:\WX2\include\wx/sizer.h(129) : see declaration of 'wxSizer'
C:\wxPython-2.3.2\src\helpers.cpp(350) : error C2039: 'SetClientObject' :

is

not
a member of 'wxSizer'
        C:\WX2\include\wx/sizer.h(129) : see declaration of 'wxSizer'
error: command '"C:\Program Files\Microsoft Visual

Studio\VC98\BIN\cl.exe"'

fail
ed with exit status 2

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

Niki's tips were also helpful in understanding
this a bit better, but I'm still pretty
confused about the whole grid behaviour
though. And it certainly seems overly
complex. Why does the behaviour of cells
in grids have to have so many layers of
behaviour on top of each other?

When you work with grids you might have
to code in the grid, in a cell renderer,
in a cell editor, in a text control and
in a validator. And some validators
(wxGenericValidator) has nothing to do
with validation, only with data transfer
for dialogs? And to get right aligned text
you need a subclass of wxTextCtrl... Is it
only me, or does this seem like a bit of a
patchwork?

The price of great flexibility is great complexity.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

Thanks Robin. I downloaded wxwindows 2.3.2 and wxpython 2.3.2. Compiled
wxwindows using vc++ and built the dll.

when I compiled wxpython, I got the below message
src/wxc.rc (5): error RC2135 : file not found: wxc.pyd.manifest
error: command '"C:\Program Files\Microsoft Visual
Studio\Common\MSDev98\Bin\rc.
exe"' failed with exit status 1

I commented out the line
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "wxc.pyd.manifest"
in wxc.rc

Now I get the below messages

C:\wxPython-2.3.2\src\msw\printfw.cpp(1702) : error C2065: 'wxPostScriptDC'
: un
declared identifier
C:\wxPython-2.3.2\src\msw\printfw.cpp(1702) : error C2065: 'src' :
undeclared id
entifier
C:\wxPython-2.3.2\src\msw\printfw.cpp(1702) : warning C4552: '*' : operator
has
no effect; expected operator with side-effect
C:\wxPython-2.3.2\src\msw\printfw.cpp(1704) : error C2059: syntax error :
')'
C:\wxPython-2.3.2\src\msw\printfw.cpp(1710) : warning C4552: '*' : operator
has
no effect; expected operator with side-effect
C:\wxPython-2.3.2\src\msw\printfw.cpp(1712) : error C2059: syntax error :
')'
C:\wxPython-2.3.2\src\msw\printfw.cpp(1720) : error C2065: '_result' :
undeclare
d identifier
C:\wxPython-2.3.2\src\msw\printfw.cpp(1720) : warning C4552: '*' : operator
has
no effect; expected operator with side-effect
C:\wxPython-2.3.2\src\msw\printfw.cpp(1738) : error C2059: syntax error :
')'
C:\wxPython-2.3.2\src\msw\printfw.cpp(1755) : warning C4552: '*' : operator
has
no effect; expected operator with side-effect
C:\wxPython-2.3.2\src\msw\printfw.cpp(1796) : error C2059: syntax error :
')'
C:\wxPython-2.3.2\src\msw\printfw.cpp(1818) : error C2065: '_arg0' :
undeclared
identifier
C:\wxPython-2.3.2\src\msw\printfw.cpp(1818) : warning C4552: '*' : operator
has
no effect; expected operator with side-effect
C:\wxPython-2.3.2\src\msw\printfw.cpp(1835) : error C2227: left of
'->GetPrintDa
ta' must point to class/struct/union
C:\wxPython-2.3.2\src\msw\printfw.cpp(1853) : warning C4552: '*' : operator
has
no effect; expected operator with side-effect
C:\wxPython-2.3.2\src\msw\printfw.cpp(1878) : error C2227: left of
'->SetPrintDa
ta' must point to class/struct/union
C:\wxPython-2.3.2\src\msw\printfw.cpp(1897) : error C2653: 'wxPostScriptDC'
: is
not a class or namespace name
C:\wxPython-2.3.2\src\msw\printfw.cpp(1897) : error C2065: 'SetResolution' :
und
eclared identifier
C:\wxPython-2.3.2\src\msw\printfw.cpp(1916) : error C2653: 'wxPostScriptDC'
: is
not a class or namespace name
C:\wxPython-2.3.2\src\msw\printfw.cpp(1916) : error C2065: 'GetResolution' :
und
eclared identifier
error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe"'
fail
ed with exit status 2

Please help.
Thanks,
Jayesh

···

----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@lists.wxwindows.org>
Sent: Monday, December 17, 2001 10:09 AM
Subject: Re: [wxPython] wxpython on win32

> I downloaded wxpython 2.3.1 source and did "python setup.py install". I
get
> the below message. I have already compiled wxwindows using Borland C++
5.5.
>
> Could someone help?
>
> Thanks,
> Jayesh
>
> C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox
/MD
> /W3
>

/GX -DWIN32 -D__WIN32__ -D_WINDOWS -D__WINDOWS__ -DWINVER=0x0400 -D__WIN95__

> -DS
>

TRICT -D__WXMSW__ -DWXUSINGDLL=1 -DSWIG_GLOBAL -DHAVE_CONFIG_H -DWXP_USE_THR

> EAD=
> 1 -Isrc -IC:\WX2\lib\mswdll -IC:\WX2\include -IC:\PYTHON21\Include
> /TpC:\wxPytho
> n-2.3.2\src\helpers.cpp /Fobuild\temp.win32-2.1\Release\src/helpers.obj
> helpers.cpp
> C:\wxPython-2.3.2\src\helpers.cpp(297) : error C2039: 'GetClientObject'

:

is
> not
> a member of 'wxEvtHandler'

You need to use the same version of wxWindows as wxPython. My guess is

that

you have wxWindows 2.3.1 and wxPython 2.3.2? Also, I'll bet that you need
to use the same compiler on both as well.

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

> C:\WX2\include\wx/event.h(1467) : see declaration of
'wxEvtHandler'
> C:\wxPython-2.3.2\src\helpers.cpp(318) : error C2039: 'SetClientObject'

:

is
> not
> a member of 'wxEvtHandler'
> C:\WX2\include\wx/event.h(1467) : see declaration of
'wxEvtHandler'
> C:\wxPython-2.3.2\src\helpers.cpp(341) : error C2039: 'GetClientObject'

:

is
> not
> a member of 'wxSizer'
> C:\WX2\include\wx/sizer.h(129) : see declaration of 'wxSizer'
> C:\wxPython-2.3.2\src\helpers.cpp(350) : error C2039: 'SetClientObject'

:

is
> not
> a member of 'wxSizer'
> C:\WX2\include\wx/sizer.h(129) : see declaration of 'wxSizer'
> error: command '"C:\Program Files\Microsoft Visual
Studio\VC98\BIN\cl.exe"'
> fail
> ed with exit status 2

Thanks Robin. I downloaded wxwindows 2.3.2 and wxpython 2.3.2. Compiled
wxwindows using vc++ and built the dll.

when I compiled wxpython, I got the below message
src/wxc.rc (5): error RC2135 : file not found: wxc.pyd.manifest
error: command '"C:\Program Files\Microsoft Visual
Studio\Common\MSDev98\Bin\rc.
exe"' failed with exit status 1

I commented out the line
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "wxc.pyd.manifest"
in wxc.rc

Yep, I forgot to include it in the tarball...

Now I get the below messages

C:\wxPython-2.3.2\src\msw\printfw.cpp(1702) : error C2065:

'wxPostScriptDC'

: un
declared identifier

...

Looks like I need to update the build instructions with different settings
in setup.h... I currently have the following settings different than what's
in setup0.h:

         wxDIALOG_UNIT_COMPATIBILITY 0
         wxUSE_GLOBAL_MEMORY_OPERATORS 0
         wxUSE_DEBUG_NEW_ALWAYS 0
         wxUSE_CMDLINE_PARSER 0
         wxUSE_DIALUP_MANAGER 0
         wxUSE_TREELAYOUT 0
         wxUSE_POSTSCRIPT 1

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

That sounds like some kind of Perl motto! :frowning:

In Python I'm used to having great flexibility
and little complexity. Aren't you? :slight_smile: I haven't
quite thought of it like that before, but now that
I think of it... That _is_ Python:

   Great flexibility and small complexity! :slight_smile:

I guess the complexibility is higher in GUI programming
than in many other types of programming, and making
a thin layer over a C++ tool kit like this doesn't fully
hide the higher complexity / flexibility ratio of C++.
I can live with C++, but I'm getting lazy from all this
comfortable Python coding. :slight_smile:

I'm not completely happy with the wxTextCtrl, and
particularly not with the way it's used in grids. When
I see that right alignment is implemented as a sub class
I start to hear these little warning bells in the back
of my head. (I assume that is to be seen as a temporary
fix.) I hope that wxTextCtrl will evolve, getting all
the styles and attibutes that could be expected from such
a thing, and to make it easy to add different features to
a control without shooting yourself in the foot. Now I
feel that fixing one thing all to often has unexpected
side effects.

But I guess I'm whining on the wrong list. This is a
wxWindows problem, not a wxPython issue...

Anyway, I certainly don't hold any grudge against the
people who are providing me with this tool kit that I
generally really like. Particularly considering how much
I am paying to use it... :slight_smile:

Maybe I belong to a minority here, who feel that this is
a problem? For me, one row text entry widgets are among
the most commonly used. I make a lot of boring administrative
software where people fill in fields with specific info.

The data might have to be right aligned, or left aligned,
and validated, adjusted, formatted, filtered, lenght limited,
hidden, required, protected etc in all sorts of combinations.

Is there anyone else who feel that this is any area to
give some attention to?

/Magnus

···

At 10:09 2001-12-17 -0800, Robin Dunn wrote:

The price of great flexibility is great complexity.

--
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se

Magnus Lyckå:

Maybe I belong to a minority here, who feel that this is
a problem? For me, one row text entry widgets are among
the most commonly used. I make a lot of boring administrative
software where people fill in fields with specific info.

The data might have to be right aligned, or left aligned,
and validated, adjusted, formatted, filtered, lenght limited,
hidden, required, protected etc in all sorts of combinations.

   The text control is based upon native platform widgets and so to some
extent suffers from the limitations of these platform widgets. It would be a
reasonable project to produce a wx-specific text entry widget with all your
desired features. 'required' is an interesting attribute in that it really
requires interaction with the form unless you are going to be nasty and trap
the focus in the entry until it is filled in. The downside of wx-specific
widgets is that they do not follow platform conventions and theming so well.

   Neil

>The price of great flexibility is great complexity.

That sounds like some kind of Perl motto! :frowning:

[snip flexibility/complexity semantics]

Hehe -- you're opening up a can of worms here.

I'm not completely happy with the wxTextCtrl, and
particularly not with the way it's used in grids.

That's the beauty of software that comes with source:
if you see an opportunity for improvement, you can
do something concrete about it.

Jack.

···

--- Magnus Lyck� <magnus@thinkware.se> wrote:

At 10:09 2001-12-17 -0800, Robin Dunn wrote:

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

>The price of great flexibility is great complexity.

That sounds like some kind of Perl motto! :frowning:

In Python I'm used to having great flexibility
and little complexity. Aren't you? :slight_smile: I haven't
quite thought of it like that before, but now that
I think of it... That _is_ Python:

   Great flexibility and small complexity! :slight_smile:

Yep, but wxGrid is C++, and wxPython's wxGrid is C++ wrapped by a horrid
mess of autogenerated C code that exposes a boatload of functions to Python
that are wrapped by a very flexible and simple Python class that happens to
look and act a lot like the original complex C++ class. <wink>

To have a highly flexible and simple wxGrid it would need to be implemented
mostly in Python...

I'm not completely happy with the wxTextCtrl, and
particularly not with the way it's used in grids. When
I see that right alignment is implemented as a sub class
I start to hear these little warning bells in the back
of my head. (I assume that is to be seen as a temporary
fix.) I hope that wxTextCtrl will evolve, getting all
the styles and attibutes that could be expected from such
a thing, and to make it easy to add different features to
a control without shooting yourself in the foot. Now I
feel that fixing one thing all to often has unexpected
side effects.

The beauty of the wxGrid is that if you don't like how the editor built
around the standard wxTextCtrl works you can create your own text control
from scratch and wrap it with your own grid editor class and plug it in to
the grid.

···

At 10:09 2001-12-17 -0800, Robin Dunn wrote:

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

Robin Dunn wrote:

···

At 10:09 2001-12-17 -0800, Robin Dunn wrote:

The price of great flexibility is great complexity.

That sounds like some kind of Perl motto! :frowning:

In Python I'm used to having great flexibility
and little complexity. Aren't you? :slight_smile: I haven't
quite thought of it like that before, but now that
I think of it... That _is_ Python:

  Great flexibility and small complexity! :slight_smile:

Yep, but wxGrid is C++, and wxPython's wxGrid is C++ wrapped by a horrid
mess of autogenerated C code that exposes a boatload of functions to Python
that are wrapped by a very flexible and simple Python class that happens to
look and act a lot like the original complex C++ class. <wink>

To have a highly flexible and simple wxGrid it would need to be implemented
mostly in Python...

When i look at wxGrid C++ sources they look like Python design translated to C++ (with RC GC etc.) :^)

Niki Spahiev

  The text control is based upon native platform widgets and so to some
extent suffers from the limitations of these platform widgets.

I've worked with other tools available on at least MS Win and
Motif (JAM/Panther) that has more or less the features I'm
talking about here (but lacks many others :frowning: ).

It would be a
reasonable project to produce a wx-specific text entry widget with all your
desired features.

I'd be happy to continue this discussion in two - three weeks.

'required' is an interesting attribute in that it really
requires interaction with the form unless you are going to be nasty and trap
the focus in the entry until it is filled in.

No, I'm not nasty in that was. I really think it's a
good thing to allow the user to work in the order he
wants, and not presume an exact key sequence...

I see that as a flag that controls whether validation
will yield ok or not if the field is empty. Let's say
that you say that the field has to contain a date. If
we imagine we have some kind of generic date validator
plugged to the control, a proper date is required for
a non empty control to validate, and "required" controls
whether it's validated ok if it's empty.

Maybe something like this:

startDate = wxTextCtrl(...)
...
startDate.SetValidator(wxDateValidator)
startDate.SetRequired(true)

I guess date validation is another can of worms I
shouldn't open though...

/Magnus

···

At 10:09 2001-12-20 +1100, you wrote:

--
Magnus Lyckå, Thinkware AB
Älvans väg 99, SE-907 50 UMEÅ
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se