I not Understand : can Have a lesson from the gurus ?

I not Understand : can Have a lesson from the gurus ?

Postby Silvio » Tue May 05, 2009 8:49 am

I try to create a sample test :
I want create a dialog with folder
on each folder I must insert some information ( says, gets, combo,...)
I must create folder small because I must insert also the keyboard of Smartphone
to save or for not to save the information of this dialog I want use btnbmp on the bottom of keyboard ( menu)
sample : Ok cancel

I saw your sample menubmp.prg Can I use this on/ for a dialog ?
Can I use it only using thr source code and not the resource ?

Then I open a Resource file :

there are many information different from a siply fwh program resources adn I want understand How create one for my fwppc application test

Can I have a lesson ?

THanks
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: I not Understand : can Have a lesson from the gurus ?

Postby Antonio Linares » Wed May 06, 2009 8:08 am

Silvio,

> I saw your sample menubmp.prg Can I use this on/ for a dialog ?

It seems as the Windows Mobile API only allows to have a menu on a window, not on a dialog.

> Can I use it only using thr source code and not the resource ?

The Windows Mobile API only allows to create a pulldown menu from resources.

http://msdn.microsoft.com/en-us/library/aa453678.aspx
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

Re: I not Understand : can Have a lesson from the gurus ?

Postby Antonio Linares » Wed May 06, 2009 8:15 am

Silvio,

We already explained the structure of a Windows Mobile menu resource in these forums:

viewtopic.php?p=41081#p41081
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

Re: I not Understand : can Have a lesson from the gurus ?

Postby Antonio Linares » Wed May 06, 2009 8:19 am

Silvio,

If a call to SHInitDialog() is performed, then it seems as a dialog may support a menu:

http://msdn.microsoft.com/en-us/library/ms911975.aspx

but we have tested it on Windows Mobile and it does not work. Maybe it is only supported on smartphones.

Code: Select all  Expand view

#pragma BEGINDUMP

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

HB_FUNC( DLGFULLSCREEN )
{
   SHINITDLGINFO shidi;
 
   memset( &shidi, 0, sizeof( SHINITDLGINFO ) );
 
   shidi.dwMask  = SHIDIM_FLAGS;
   shidi.hDlg    = ( HWND ) hb_parnl( 1 );
   shidi.dwFlags = 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

Re: I not Understand : can Have a lesson from the gurus ?

Postby Antonio Linares » Wed May 06, 2009 8:26 am

Silvio,

It properly works :-)

We simply missed to create menudlg.rc (copied from menubmp.rc):

menudlg.prg
Code: Select all  Expand view

// FiveWin for Pocket PC - Testing menus with bitmaps

#include "FWCE.ch"

//----------------------------------------------------------------------------//

function Main()

   local oDlg

   DEFINE DIALOG oDlg TITLE "Menus & bmps"

   ACTIVATE DIALOG oDlg ;
      ON INIT ( DlgFullScreen( oDlg:hWnd ), oDlg:SetMenu( BuildMenu() ) )
     
return nil

//----------------------------------------------------------------------------//

function BuildMenu()

   local oMenu
   
   DEFINE MENU oMenu RESOURCE 102 ;
      BITMAPS 10 ; // bitmap resources ID
      IMAGES 2     // number of images in the bitmap
   
   REDEFINE MENUITEM ID 110 OF oMenu ACTION MsgInfo( "OK" )

   REDEFINE MENUITEM ID 120 OF oMenu ACTION MsgInfo( "Cancel" )

return oMenu

//----------------------------------------------------------------------------//

#pragma BEGINDUMP

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

HB_FUNC( DLGFULLSCREEN )
{
   SHINITDLGINFO shidi;
 
   memset( &shidi, 0, sizeof( SHINITDLGINFO ) );
 
   shidi.dwMask  = SHIDIM_FLAGS;
   shidi.hDlg    = ( HWND ) hb_parnl( 1 );
   shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
 
   SHInitDialog( &shidi );
}

#pragma ENDDUMP
 

menudlg.rc
Code: Select all  Expand view

#ifdef _CE
   #include "c:\vce\include\arm\windows.h"
   #include "c:\vce\include\arm\commctrl.h"
#endif

#define I_IMAGENONE     (-2)
#define IDS_HELP      104

#ifdef _CE
102 RCDATA
BEGIN
   102, 3,
   0, 110, TBSTATE_ENABLED, TBSTYLE_BUTTON, 201, 0, 0,  
   0, 105, TBSTATE_ENABLED, TBSTYLE_SEP, -1, 0, 0,
   1, 120, TBSTATE_ENABLED, TBSTYLE_BUTTON, 202, 0, 0  
END
#endif

STRINGTABLE DISCARDABLE
BEGIN
   201 "OK"
   202 "Cancel"
END

102 MENU DISCARDABLE
BEGIN
    MENUITEM "", 110
    MENUITEM "", 120
END

10 BITMAP "../bitmaps/pocket/okcancel.bmp"
 

Image
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

Re: I not Understand : can Have a lesson from the gurus ?

Postby Silvio » Wed May 06, 2009 8:50 am

Antonio,
thanks Now I must read and try all !!!
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: I not Understand : can Have a lesson from the gurus ?

Postby Silvio » Wed May 06, 2009 11:49 am

Antonio, CAN I insert a panel on folder ?

BecauseI must insert many informations

#include "FWCE.ch"

//----------------------------------------------------------------------------//

function Main()

local oDlg
Local oFld, oPanel
DEFINE DIALOG oDlg TITLE "Inserimento"

@ 0.0, 0 FOLDER oFld PROMPTS "Generale", "Dettagli", "Note" ;
SIZE 119, 95

@ 10, 10 PANEL oPanel OF oFld:aDialogs[ 1 ];
SIZE 100,80

@ 0.5, 1 SAY "First:" OF oPanel SIZE 30, 15

ACTIVATE DIALOG oDlg ;
ON INIT ( DlgFullScreen( oDlg:hWnd ), oDlg:SetMenu( BuildMenu() ) )

return nil

//----------------------------------------------------------------------------//

function BuildMenu()

local oMenu

DEFINE MENU oMenu RESOURCE 102 ;
BITMAPS 10 ; // bitmap resources ID
IMAGES 2 // number of images in the bitmap

REDEFINE MENUITEM ID 110 OF oMenu ACTION MsgInfo( "OK" )

REDEFINE MENUITEM ID 120 OF oMenu ACTION MsgInfo( "Cancel" )

return oMenu

//----------------------------------------------------------------------------//

#pragma BEGINDUMP

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

HB_FUNC( DLGFULLSCREEN )
{
SHINITDLGINFO shidi;

memset( &shidi, 0, sizeof( SHINITDLGINFO ) );

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

SHInitDialog( &shidi );
}

#pragma ENDDUMP
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 11 guests