DoLayoutAdaptation()

wxWindows

    Next

  • 1. wx.grid and cell change event
    how would i go about triggering a cell change event on a wx.grid? i have a def that accepts a event object as an arguement. i do a bunch of SetCellValue()'s and i want to call it/trigger a wx.grid.EVT_GRID_CELL_CHANGE(RosterWorkPanel, self.InsertRow) when i'm done --------------------------------------------------------------------- To unsubscribe, e-mail: XXXX@XXXXX.COM For additional commands, e-mail: XXXX@XXXXX.COM
  • 2. wxPython 2.5 - bug in wx.Execute
    Hi, I need a help with following problem which is blocking me quite seriously. I noted some weird behavior on Windows (Python 2.3, wxPython 2.5). The same code works fine under Linux. When using id = wx.Execute(cmd, wx.EXEC_ASYNC, self.process)to spawn new wxPython based GUI program, the GUI does not pop up. I checked that the process itself is running/alive, the print over the streams get propagated to the parent process, but no GUI. It only happnes for wxPython based programs - for e.g. regural python command line programs it works fine. It is easy to be replicated using wx Demo by opening Process and Events/Process. Then after typing in "python -u demo.py" nothing happens. Please help, it really blocks me. The temporary work around is to use "cmd /e python -u demo.py", but I lose the unbuffered -u effect. Thanks, Andy --------------------------------------------------------------------- To unsubscribe, e-mail: XXXX@XXXXX.COM For additional commands, e-mail: XXXX@XXXXX.COM

DoLayoutAdaptation()

Postby John Roberts » Wed, 21 Jan 2009 20:51:29 GMT

This is a multi-part message in MIME format.


DoLayoutAdaptation() is a good feature for wxDialog.
I note it removes focus from any control in the dialog, which is probably unavoidable given the reparenting of controls, but then focus defaults to the default button.
When using ShowModal() there is no way to set focus back to where you want focus when the dialog is shown unless I am missing something.
Cheers, John
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6001.18183" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>DoLayoutAdaptation() is a good feature for 
wxDialog.</FONT></DIV>
<DIV><FONT face=Arial size=2>I note it removes focus from any control in the 
dialog, which is probably unavoidable given the reparenting of 
controls, but then focus defaults to the default button.</FONT></DIV>
<DIV><FONT face=Arial size=2>When using ShowModal() there is no way to set focus 
back to where you want focus when the dialog is shown unless I am missing 
something.</FONT></DIV>
<DIV><FONT face=Arial size=2>Cheers, John</FONT></DIV></BODY></HTML>


Re: DoLayoutAdaptation()

Postby Julian Smart » Wed, 21 Jan 2009 21:08:29 GMT

Hi John,



Good point - maybe we need to change wxDialogBase::DoLayoutAdaptation() 
in src/common/dlgcmn.cpp to something like this:

/// Do the adaptation
bool wxDialogBase::DoLayoutAdaptation()
{
    if (GetLayoutAdapter())
    {
        wxWindow* focusWindow = wxFindFocusDescendant(this); // from event.h
        if (GetLayoutAdapter()->DoLayoutAdaptation((wxDialog*) this))
        {
            if (focusWindow)
                focusWindow->SetFocus();
            return true;
        }
        else
            return false;
    else
        return false;
}

Perhaps you could try this and if it helps, I can add it to SVN?

Thanks,

Julian

-- 
Julian Smart, Anthemion Software Ltd.
28/5 Gillespie Crescent, Edinburgh, Midlothian, EH10 4HU
www.anthemion.co.uk | +44 (0)131 229 5306
Tools for writers: www.writerscafe.co.uk
wxWidgets RAD:     www.dialogblocks.com
Blog:              www.juliansmart.com


Re: DoLayoutAdaptation()

Postby John Roberts » Thu, 22 Jan 2009 20:44:09 GMT

----- Original Message ----- 
From: "Julian Smart" < XXXX@XXXXX.COM >
To: < XXXX@XXXXX.COM >
Sent: Tuesday, January 20, 2009 9:08 PM
Subject: Re: DoLayoutAdaptation()




Tested and works a treat.
wxFindFocusDescendant(this); // from event.h I will have to have a look at 
this when I get time ( not in my doxygen gen .chm help)
Before you commit, add the closing brace between the first "return false" 
and the last "else".
Cheers, John 



Return to wxWindows

 

Who is online

Users browsing this forum: No registered users and 2 guest