Empty menu

Empty menu

Postby pawelu » Sun Nov 06, 2005 7:28 am

Hello,

It is possible create window with empty menu ?

Regards
Pawel
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Sun Nov 06, 2005 9:05 am

Pawel,

Do you mean a menu with no menuitems ?

If so, whats its purpouse ?
regards, saludos

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

Postby pawelu » Sun Nov 06, 2005 9:36 am

Antonio,

This window is dialog. I found in eVc BasicDialog sample. Dialog is paint on full screen and have empty menu. This dialog looks very well. Right corner show Ok buttton vs standard X button.
Dialog on init use SHIDIF_DONEBUTTON | SHIDIF_SIZEDLGFULLSCREEN and SHCMBF_HIDESIPBUTTON | SHCMBF_EMPTYBAR define but I don't know how send this message to init dialog procedure.

Pawel
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Sun Nov 06, 2005 10:42 am

Pawel,

Try this:

Code: Select all  Expand view
ACTIVATE DIALOG oDlg ... ON INIT SetWindowLong( oDlg:hWnd, GWL_EXSTYLE, nOr( GetWindowLong( oDlg:hWnd, GWL_EXSTYLE ), SHIDIF_DONEBUTTON,  SHIDIF_SIZEDLGFULLSCREEN, SHCMBF_HIDESIPBUTTON, CMBF_EMPTYBAR ) )


Please let us know if it works ok.
regards, saludos

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

Postby pawelu » Sun Nov 06, 2005 11:52 am

Antonio,

I try and try ... and nothing to change dialog. Maybe my code is wrong ?
When I use GWL_EXSTYLE GetWindowLong () return 0, GWL_STYLE return value <> 0 but dialog is still standard.

Code: Select all  Expand view
#define GWL_STYLE                   (-16)
#define GWL_EXSTYLE                 (-20)
#define SHIDIM_FLAGS                1 // 0x0001
#define SHIDIF_DONEBUTTON           1 // 0x0001
#define SHIDIF_SIZEDLG              2 // 0x0002
#define SHIDIF_SIZEDLGFULLSCREEN    4 // 0x0004
#define SHIDIF_SIPDOWN              8 // 0x0008

Function TestDialog ()

Local cGet := Space (50)

Define Dialog oDlg Resource 'BasicDialog'
ReDefine Get cGet Id 1 Of oDlg
ReDefine Button Id 2 Of oDlg Action oDlg : End ()
Activate Dialog oDlg On Init ;
SetWindowLong (oDlg : hWnd, GWL_STYLE, ;
nOr (GetWindowLong (oDlg : hWnd, GWL_STYLE), ;
SHIDIF_DONEBUTTON, SHIDIF_SIZEDLGFULLSCREEN))

Return .T.

// rc.file
BASICDIALOG DIALOG DISCARDABLE 0, 0, 160, 168
STYLE WS_POPUP|WS_VISIBLE
FONT 8, "Tahoma"
BEGIN
    CONTROL "", 1, "Edit", ES_MULTILINE|WS_BORDER|WS_TABSTOP, 32, 4, 124, 20
    CONTROL "OK", 2, "Button", WS_TABSTOP, 116, 148, 40, 12
END


Pawel
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Sun Nov 06, 2005 3:08 pm

Pawel,

Try to use those defines in the RC file:

STYLE WS_POPUP | WS_VISIBLE | SHIDIF_DONEBUTTON | SHIDIF_SIZEDLGFULLSCREEN

...

Tested it here. It does not work.

We may search on google for a C sample that uses SHIDIF_DONEBUTTON
regards, saludos

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

Postby Antonio Linares » Sun Nov 06, 2005 3:16 pm

regards, saludos

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

Postby Antonio Linares » Sun Nov 06, 2005 3:28 pm

Pawel,

Its working :)

Code: Select all  Expand view
   ACTIVATE DIALOG oDlg CENTERED ;
     ON INIT SetOKButton( oDlg:hWnd )
   
return nil   

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>

HB_FUNC( SETOKBUTTON )
{
   SHINITDLGINFO shidi;

   shidi.dwMask  = SHIDIM_FLAGS;
   shidi.hDlg    = ( HWND ) hb_parnl( 1 );
   shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIZEDLGFULLSCREEN;

   SHInitDialog( &shidi );
}   

#pragma ENDDUMP
regards, saludos

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

Postby pawelu » Sun Nov 06, 2005 4:11 pm

Antonio,

thanks so much

Pawel
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Sun Nov 06, 2005 6:28 pm

Pawel,

Still we need to know what command generates the click of the OK at the right top corner.
regards, saludos

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

Postby pawelu » Mon Nov 07, 2005 7:43 am

Antonio,

I found this in BasicDialog sample:

Code: Select all  Expand view
    case WM_COMMAND:
        // Dialog manager produces IDOK when the done button is tapped
        if ((IDOK == LOWORD(wParam)) || (IDCANCEL == LOWORD(wParam)))
        {
            EndDialog(hDlg, LOWORD(wParam));
            return TRUE;
        }
        break;


Pawel
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Mon Nov 07, 2005 12:19 pm

Pawel,

Its a little more complex than that, but we already got it working :)

There is a new FWPPC build ready to be downloaded. Please review samples\okbutton.prg working sample to see how to use it.
regards, saludos

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

Postby pawelu » Mon Nov 07, 2005 4:39 pm

Antonio,

I modify SetOkButton with this (empty menu bar):

Code: Select all  Expand view
#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>

HB_FUNC (SETOKBUTTON)

{
   
   HWND hDlg = (HWND) hb_parnl (1);

   SHINITDLGINFO shidi;

   shidi.dwMask  = SHIDIM_FLAGS;
   shidi.hDlg    = hDlg;
   shidi.dwFlags = SHIDIF_DONEBUTTON|SHIDIF_SIZEDLGFULLSCREEN;

   SHInitDialog (&shidi);

   SHMENUBARINFO mbi;

   memset(&mbi, 0, sizeof (SHMENUBARINFO));
   mbi.cbSize = sizeof (SHMENUBARINFO);
   mbi.hwndParent = hDlg;
   // mbi.hInstRes = g_hInst; // ???
   mbi.dwFlags = SHCMBF_EMPTYBAR;
   SHCreateMenuBar (&mbi);

}   

#pragma ENDDUMP


Dialog is now perfect.

Best regards
Pawel
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Mon Nov 07, 2005 8:02 pm

Pawel,

Very good :)
regards, saludos

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

Postby GWard » Tue Nov 08, 2005 10:17 am

Antonio Linares wrote:Pawel,

Its a little more complex than that, but we already got it working :)

There is a new FWPPC build ready to be downloaded. Please review samples\okbutton.prg working sample to see how to use it.


Antonio,

How can I get the OK button to close the current WINDOW when using nested windows.

The code in samples\okbutton.prg changes the "X" to an "OK" but nothing happens when I click the "OK"

I am using
Code: Select all  Expand view
ACTIVATE WINDOW oWnd ON INIT SetOkButton(oWnd:hWnd)
GWard
 
Posts: 31
Joined: Thu Oct 13, 2005 10:18 am
Location: UK

Next

Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 7 guests