This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Native windows problem..


Native windows problem..

Postby RapchikProgrammer » Oct 13, 2009 @ 10:11am

Hey, i have made a text box using native window with createwindowex.. now the problem is when i click on it then the focus gets shifted to the textbox and the OnNextFrame is no longer called.. How do i shift the focus back to the parent edgelib window? I have tried setfocus and sending a WM_SETFOCUS message but both are not working.. if i minimize and restore my window then the apps main loop works fine, otherwise if i click on the textbox it doesnt work.. and i am handling messages using OnNativeEvent..
RapchikProgrammer
pm Member
 
Posts: 56
Joined: Oct 18, 2008 @ 7:08am


Postby RapchikProgrammer » Oct 13, 2009 @ 10:15am

I just checked again with setfocus the focus is shifting to the main window but the OnNextFrame function isnt being called like it should..
RapchikProgrammer
pm Member
 
Posts: 56
Joined: Oct 18, 2008 @ 7:08am


Postby edge » Oct 15, 2009 @ 1:06pm

Hi,

To solve the issue you could keep the application running when the window loses focus. Set config->focussuspend to false in OnFrameworkConfig. The window will be suspended while minimized though.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby RapchikProgrammer » Oct 15, 2009 @ 2:02pm

Thanks that sorted it out..
RapchikProgrammer
pm Member
 
Posts: 56
Joined: Oct 18, 2008 @ 7:08am


Postby RapchikProgrammer » Oct 15, 2009 @ 2:24pm

Theres still one problem tho, now when i click on that textbox then the focus is on the textbox.. and when i click the continue button that removes the textbox and continues the game, im getting the stylus down and up events in OnNative event and not in OnStylusDown and OnStylusUp events, edgelibs not getting these events.. even though i have used setfocus after removing the textbox to give the focus back to the window..
RapchikProgrammer
pm Member
 
Posts: 56
Joined: Oct 18, 2008 @ 7:08am


Postby RapchikProgrammer » Oct 16, 2009 @ 2:12pm

Another issue, i have been only tesing on pc till now.. i tried to run it on the cellphone and im facing two problems.. firstly, as soon as i click on the textbox the window minimizes.. and if i restore i only see the textbox and no background as i am not refreshing the complete display ofcourse, so what might be causing this.. the textbox is the child of the main window and i am not seeing this issue in windows, just windows mobile..

secondly my game is running in landscape mode.. i have set DOR_LANDSCAPE but it seems like only the edgelib window is in landscape but the child is still made in portrait mode.. because if i run the game on my wm device the textbox is displayed sideways.. its going from centre to up like in portait mode not centre to right like it should.. if i hold the phone in landscape mode before running the game and let the phones tilt orientation mechanism kick in and set the phones orientation to landscape than it works fine but otherwise it doesnt..
RapchikProgrammer
pm Member
 
Posts: 56
Joined: Oct 18, 2008 @ 7:08am


Postby RapchikProgrammer » Oct 17, 2009 @ 8:51pm

BTW edge our game is in the releasing stages.. and all this code is supposed to be for authorization (entering license key) which the last stage.. so could you please send me an im id or maybe check the forums a bit regularly so that we can get over these problems and release our game asap..
RapchikProgrammer
pm Member
 
Posts: 56
Joined: Oct 18, 2008 @ 7:08am


Postby edge » Oct 19, 2009 @ 8:35am

Hi,

Unfortunately, I can't say why the parent window doesn't gain focus when the child window is removed, perhaps Windows only allow childs to obtain focus in your situation? Maybe changing the order of calling SetFocus and DestroyWindow may help?

To prevent minimizing your application, set config->focusminimize to false in OnFrameworkConfig.

The landscape/textbox issue might become a problem. In certain cases, you can't prevent the orientation from changing (when the user slides out his keyboard for example). This will make the EDGELIB application run in landscape, while the texbox changes to portrait. You can force the orientation with ChangeDisplaySettingsEx and DM_DISPLAYORIENTATION, but I think it won't solve the issue mentioned above. The best way to handle this is to support multiple orientations and set the config->orientation option to DOR_AUTO.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron