From: Mark W. <ma...@ne...> - 2005-03-14 08:15:38
|
Hi Mattia, I managed to override the EVT_CHAR handler and I seem to be catching "most" of the keypresses, but as experienced in other areas of wxWidgets development I am not seeing Tab, Enter and Escape. Is this another case of using the wxWANTS_CHARS flag? If so, I assume I would need this on the constructor of the canvas? Or could I use it on the creation of the PreviewFrame (I tried but had no success). The only way to try and use this flag on the canvas is to hardwire the wxWidgets source and putting it in prntbase.cpp. Has anyone alse been down this road yet and have any words of advice to offer? Many thanks Mark -----Original Message----- From: Mattia Barbon [mailto:mat...@li...] Sent: 12 March 2005 07:53 PM To: Mark Wardell; 'wxperl-users' Subject: Re: [wxperl-users] Wx::PreviewFrame issues On Fri, 11 Mar 2005 10:22:38 +0200 Mark Wardell <ma...@ne...> wrote: Hello, > I am trying to enhance the printing and previewing side of things ... > > I have a Wx::Dialog with report related options and buttons that > launch a Wx::PreviewFrame by means of a Preview button. With the > PreviewFrame active and I have clicked on the Print canvas to be sure, > if I push Enter the default button on the dialog (now hidden and > behind the PreviewFrame) is activated and another preview frame is > created, if I press the Escape key the wxID_CANCEL button is activated > and the dialog closes leaving the PreviewFrame on screen. Has anyone had any experience with this? > > Is there anyway to override the CreateControlBar or Initialize > methods? If I could do this then I could try and look at control focus > issues regrading above problem. I could also create my own ControlBar with improved features. Looking at the C++ code it might not be that simple (the code does not look very flexible). As far as I can see your problem comes from the EVT_CHAR handler of the wxPreviewCanvas. As a workaround you could try to: * call $previewframe->Initialize * use $previewframe->GetChildren and get the wxPreviewCanvas * add an empty EVT_CHAR handler Regards Mattia |