wxListCtrl or wxListView

I am getting ready to wrap either wxListCtrl or wxListView as a
"presenter" within Mindwrapper's MVP framework. The docs have this
to say about the two classes:

"""
  Using [wxListView] is preferable to using wxListCtrl directly
  whenever possible because in the future some ports might
  implement wxListView but not the full set of wxListCtrl features.
"""

Is this still the case? If wx.ListView can do all that I want, can
anyone think of a reason to use wxListCtrl instead?

Thanks,

···

=====
Donnal Walter
Arkansas Children's Hospital

Donnal Walter wrote:

I am getting ready to wrap either wxListCtrl or wxListView as a
"presenter" within Mindwrapper's MVP framework. The docs have this
to say about the two classes:

"""
  Using [wxListView] is preferable to using wxListCtrl directly
  whenever possible because in the future some ports might
  implement wxListView but not the full set of wxListCtrl features.
"""

Is this still the case? If wx.ListView can do all that I want, can
anyone think of a reason to use wxListCtrl instead?

Currently wxListView is just a simple derivation of wxListCtrl that adds some easier to use methods. There is probably no reason not to use it in your framework.

···

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

i have an application made with wxPython.. and now.. from within the
application i want
to open a chm.... (help file for windows)

i was thinking of using
os.execlp("hh.exe","hh.exe "+"help.chm")

my problem is that it closes the application.... (accordind to python's help
it should do that)
however i need to keep the application runnig... so my solution
was using a fork creating a child process and then opening the chm file i
need... but windows hasn't got fork...

so how can i do this???
help me please!

Here's what I have done in the past and it seems to work well:

···

#
----------------------------------------------------------------------------
# The Help..Contents menu command
    def OnMnuHelpContents(self, event):
        """This method opens the Help file (if it isn't open already)."""
        # Display the help file - nothing fancy - just run it
        # ToDo - if already running bring to top (I can't see a way to do
        # this, currently)
        global helpfile_active

        helpfilename = os.path.join(eemgr_globals._runpath, r'eemgr.chm')
        if not helpfile_active:
            helpprocid = wxNewId()
            self.helpfile_process = wxProcess(self, helpprocid)
            EVT_END_PROCESS(self, helpprocid, self.OnHelpWindowTerminate)
            helpfile_active = wxExecute('hh.exe %s' % helpfilename, False,
                                    self.helpfile_process)

#
----------------------------------------------------------------------------
    def OnHelpWindowTerminate(self, event):
        """This event function is fired when the help window is closed."""
        global helpfile_active

        if helpfile_active:
            self.helpfile_process.Detach()
            self.helpfile_process.Destroy()
        helpfile_active = 0

"Tiago Duarte Felix" <tdf@mega.ist.utl.pt> wrote on 10/04/2003 01:12:43 PM:

i have an application made with wxPython.. and now.. from within the
application i want
to open a chm.... (help file for windows)

Tiago Duarte Felix wrote:

i have an application made with wxPython.. and now.. from within the
application i want
to open a chm.... (help file for windows)

i was thinking of using
os.execlp("hh.exe","hh.exe "+"help.chm")

my problem is that it closes the application.... (accordind to python's help
it should do that)

I haven't tested this, but you could probably just use

os.system("start help.chm")

which should get Explorer to start an independent process for your help file.

Jeff Shannon
Technician/Programmer
Credit International

Hi all,

I have asked a couple of questions about grids recently. I now have two
more. I think I should explain what I am trying to accomplish, otherwise the
questions may seem a bit odd.

I am writing a "simple" accounting system. I saw a reference to "simple" the
other day, which dovetails exactly with my feelings towards it. It went
something like this -

"I have done what you asked, but unfortunately I did not have the time to
come up with a simple solution, so I did it in a complicated way."

I believe that, for data entry purposes, it must be possible to enter and
accept a batch of transactions using only the keyboard. Obviously the mouse
can be used as well, but it should not be a requirement.

I am designing an invoice capture screen. There are a number of text
controls, such as Account Number, Invoice Date, etc, followed by a grid to
enter an unlimited number of detail lines, followed by some more text
controls, such as Invoice Total, Tax, etc, and then buttons for Save or
Cancel.

I want the user to be able to tab seamlessly from the first set of controls
into the grid, from there into the second set of controls, and backtab in
the opposite direction. It seems that grids are not really designed to work
this way, but I have come up with solutions to every problem I have come
across until now, and it is looking quite smooth.

Now I have bumped my head up against two problems that I cannot find a
solution to. Platforms are Windows 2000, Python 2.2.2, wxPython 2.4.0.2u,
and Linux (Redhat 8), Python 2.2.2, wxPython 2.4.0.2.

1. I use EVT_KEY_DOWN in the grid to detect tab and backtab. I can detect
them both in Linux. I can detect tab in Windows, but I cannot detect
backtab. If I display the keystrokes detected, it detects the shift key, but
returns nothing for the tab key.

2. I use SetCellHighlightPenWidth() to hide or show the grid cursor. I want
it to be visible while the user is in the grid, and invisible otherwise. I
can make it invisible initially. I can make it visible when the user enters
the grid. I cannot make it invisible again when they leave the grid, even
though I am calling SetCellHighlightPenWidth(0). This happens on both Linux
and Windows.

Any assistance will be much appreciated.

Frank Millman

Frank Millman wrote:

Now I have bumped my head up against two problems that I cannot find a
solution to. Platforms are Windows 2000, Python 2.2.2, wxPython 2.4.0.2u,
and Linux (Redhat 8), Python 2.2.2, wxPython 2.4.0.2.

1. I use EVT_KEY_DOWN in the grid to detect tab and backtab. I can detect
them both in Linux. I can detect tab in Windows, but I cannot detect
backtab. If I display the keystrokes detected, it detects the shift key, but
returns nothing for the tab key.

A little playaround with the wxKeyEvent sample in the demo shows this too. It has something to do with the navigation events because when that sample is run standalone so it is the only thing in a frame then Shift-Tab is captured just fine. Please enter a bug report about this.

You might be able to work around it by catching EVT_NAVIGATION_KEY.

2. I use SetCellHighlightPenWidth() to hide or show the grid cursor. I want
it to be visible while the user is in the grid, and invisible otherwise. I
can make it invisible initially. I can make it visible when the user enters
the grid. I cannot make it invisible again when they leave the grid, even
though I am calling SetCellHighlightPenWidth(0). This happens on both Linux
and Windows.

Where are you calling SetCellHighlightPenWidth(0) from? Is it from an event handler that may not be getting called for some reason?

···

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

Frank Millman wrote:
> 1. I use EVT_KEY_DOWN in the grid to detect tab and backtab. I can

detect

> them both in Linux. I can detect tab in Windows, but I cannot detect
> backtab. If I display the keystrokes detected, it detects the shift key,

but

> returns nothing for the tab key.

A little playaround with the wxKeyEvent sample in the demo shows this
too. It has something to do with the navigation events because when
that sample is run standalone so it is the only thing in a frame then
Shift-Tab is captured just fine. Please enter a bug report about this.

You might be able to work around it by catching EVT_NAVIGATION_KEY.

I have posted the bug report as requested.

I do not get any response from EVT_NAVIGATION_KEY - I am probably using it
incorrectly. I can wait for the fix to EVT_KEY_DOWN (assuming that we are
talking weeks, not months), so I will not spend any more time on this.
Thanks for the suggestion.

>
> 2. I use SetCellHighlightPenWidth() to hide or show the grid cursor. I

want

> it to be visible while the user is in the grid, and invisible otherwise.

I

> can make it invisible initially. I can make it visible when the user

enters

> the grid. I cannot make it invisible again when they leave the grid,

even

> though I am calling SetCellHighlightPenWidth(0). This happens on both

Linux

> and Windows.

Where are you calling SetCellHighlightPenWidth(0) from? Is it from an
event handler that may not be getting called for some reason?

Just a silly bug - sorry. After trapping tab or shift-tab, in most cases I
"set focus" on another cell, so I was always calling my cell selection
routine at the end of my OnKeyDown routine, which in turn switched on the
grid cursor.
Now I check if I have left the grid, and if so I do not call the cell
selection routine. It works fine now. Sorry about that.

Frank Millman

···

----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Friday, April 11, 2003 9:46 PM
Subject: Re: [wxPython-users] Problems with grid