PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

CGapiApplication class and CDialog on PocketPC

I have sub-classed CGapiApplication and I get everything working well (PocketPC emulator 2000 and 2002). The problem is when I want to display a CDialog, with the simplest DoModal() call : Instead of the title bar (with the pretty usefull 'close' button), I get a blank (gray) area with no buttons, no title, just nothing !

I'm calling DoModal() from the KeyDown() callback. Could this block the message queue, and therefore prevent the window messages to reach WindowProc() ?

Thanks. Danoul
Hi,

Um. Showing a simple dialog is not as simple as it sounds..

I would recommend not to use standard dialogs, but to make them yourself with PtInRect and graphic bitmaps.

/Johan
Gapi's complete lack of knowledge regarding windows pretty much makes all the standard windows controls useless. I've actually gone the drastic measure of recreating a mini-MFC set to replicate buttons, text labels, dialog boxes, and text boxes.
Pejo Software - Per · 20 Jul 2002, 07:58 UTC
It is possible to show a dialog when using gapidraw.
I am doing this in my game Beshaped (I didn't feel like implementing a SIP control). Before showing the dialog you should make sure that you don't update the graphics with gapidraw and that you are not running in fullscreen mode. You could use the ToggleFullscreen function in CGapiApplication.
Danoul,

If you need dialog boxes, I thought I could add some tips:

(1) In keydown/up, stylus down/up etc, don“t add more code than necessary. Just set a member variable indicating the current stylus/key status. The reason for this is that you will lock the entire message pump in Windows if you do any processing here.

(2) ToggleFullscreen() in CGapiApplication is a private member, so you cannot call it. The rationale for this is:
(a) When you switch from full screen, you may have to suspend the drawing to the display (m_display.SuspendDisplay()). You may not however want to give the user full access to the keys (m_input.SuspendInput()).
(b) By default, ToggleFullscreen() shows all adornments, including the start menu flag and SIP input. In many cases you do not want all adornments to be shown (like the windows flag).

So.. To sum up:
(1) Show your dialog from ProcessNextFrame()
(2) call m_display.SuspendDisplay before showing the dialog.
(3) Call SHFullScreen to show the SIP, but do not show the window flag (I am not 100% this is possible when showing dialogs).
(4) Show the task bar, look at the code from ToggleFullscreen()...

You may have to poke around a bit to get it to work reliable..

/Johan


/Johan