OK Icon on application Windows

OK Icon on application Windows

Postby GWard » Tue Oct 25, 2005 8:50 am

Is it possible to replace the "X" close icon with the "OK" icon on all application windows created from parent windows.
GWard
 
Posts: 31
Joined: Thu Oct 13, 2005 10:18 am
Location: UK

Postby Antonio Linares » Tue Oct 25, 2005 8:57 am

GWard,

I think it only works on dialogboxes adding this style to the dialogbox resource: EXSTYLE WS_EX_CAPTIONOKBTN
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby GWard » Tue Oct 25, 2005 9:52 am

Antonio Linares wrote:GWard,

I think it only works on dialogboxes adding this style to the dialogbox resource: EXSTYLE WS_EX_CAPTIONOKBTN


Antonio,

I am using WINDOWs because of the additional usable area and ability to hold multiple options within the MENU.

My application is designed similar to "Pocket Word". I have a Company Logo dominating the first window with a MENU allowing access to the various system operations.

On all subsequent WINDOWs with MENUs I want to display the same "OK" icon that is used on child windows as in "Pocket Word" simply to denote that the user is not closing the entire application only the current WINDOW.
GWard
 
Posts: 31
Joined: Thu Oct 13, 2005 10:18 am
Location: UK

Postby Antonio Linares » Tue Oct 25, 2005 11:54 am

GWard,

I have not tried it myself, but maybe this may work:

Code: Select all  Expand view
DEFINE WINDOW oWnd ...

nStyle = GetWindowLong( oWnd:hWnd, GWL_STYLE )                 SetWindowLong( oWnd:hWnd, GWL_STYLE, nOr( nStyle, WS_EX_CAPTIONOKBTN ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby GWard » Tue Oct 25, 2005 12:30 pm

Antonio Linares wrote:GWard,

I have not tried it myself, but maybe this may work:

Code: Select all  Expand view
DEFINE WINDOW oWnd ...

nStyle = GetWindowLong( oWnd:hWnd, GWL_STYLE )                 SetWindowLong( oWnd:hWnd, GWL_STYLE, nOr( nStyle, WS_EX_CAPTIONOKBTN ) )


Antonio,

Sorry but I am new to FiveWin.

What do I need to #include in my .prg file to get the values of GWL_STYLE and WS_EX_CAPTIONOKBTN for use in the functions you mention.
GWard
 
Posts: 31
Joined: Thu Oct 13, 2005 10:18 am
Location: UK

Postby GWard » Tue Oct 25, 2005 12:51 pm

Antonio,

I used

#define GWL_STYLE -16
#define WS_EX_CAPTIONOKBTN 0x80000000

(Found them on a Web site)

Then :

DEFINE WINDOW oWnd TITLE "Orders"

nStyle = GetWindowLong( oWnd:hWnd, GWL_STYLE )
SetWindowLong( oWnd:hWnd, GWL_STYLE, nOr( nStyle, WS_EX_CAPTIONOKBTN ) )

The Icon remains as an "X" and not "OK"

The "Orders" WINDOW contains a COMBOBOX and LISTBOX.

The LISTBOX represents storage areas which when tapped on column 2 displays all of the individual products within that location in another WINDOW with a LISTBOX.

When I return from the product WINDOW and tap the "X" in the "Orders" WINDOW it does not exit. If I tap it again the "X" vanishes completely.

If I do not enter the products WINDOW the "X" operates as expected.

Are my define values wrong.

I trust I am not overusing the forum but I am nearly there with my application and the client is overjoyed.

Many thanks
GWard
 
Posts: 31
Joined: Thu Oct 13, 2005 10:18 am
Location: UK

Postby Antonio Linares » Tue Oct 25, 2005 4:42 pm

GWard,

Your defines are ok. It seems as the windows don't allow such style. We have modified FWPPC to allow DEFINE WINDOW ... STYLE ... clause (as FW for PC) but the OK button at the caption area does not show :( .

It looks as you may need to use a dialogbox to get the OK button on the caption. Maybe you could use pushbuttons at the bottom instead of a pulldown menu ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Tue Oct 25, 2005 5:59 pm

GWard,

We have found this Pocket PC API function:

http://msdn.microsoft.com/library/defau ... l_ztgv.asp

but sadly doesn't work too, the way we need it...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby GWard » Wed Oct 26, 2005 8:50 am

Antonio Linares wrote:GWard,

It looks as you may need to use a dialogbox to get the OK button on the caption. Maybe you could use pushbuttons at the bottom instead of a pulldown menu ?


Antonio,

I simply require too many options to utilise pushbuttons.

The "OK" button on child windows is a nice touch rather than essential. As long as the "X" never closes the entire application that is.

I wonder how they manage to do it in "Pocket Word"
GWard
 
Posts: 31
Joined: Thu Oct 13, 2005 10:18 am
Location: UK


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 7 guests