FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Pocket PC Boton cerrar en dialogo.
Posts: 105
Joined: Thu Oct 20, 2005 12:29 PM
Boton cerrar en dialogo.
Posted: Tue Jul 06, 2010 11:35 PM

como se puede colocar en un dialogo en vez de la x para cerar, el ok que sale en msginfo.

Gracias.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Boton cerrar en dialogo.
Posted: Wed Jul 07, 2010 12:03 PM
Sim贸n,

Code (fw): Select all Collapse
// FiveWin for Pocket PC - Using DialogBoxes

#include "FWCE.ch"

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

function Main()

聽 聽local oWnd

聽 聽DEFINE WINDOW oWnd TITLE "OK-Button" ;
聽 聽 聽 MENU BuildMenu()

聽 聽ACTIVATE WINDOW oWnd ;
聽 聽 聽 ON CLICK MsgInfo( "Click!" )
聽 聽
return nil

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

function BuildMenu()

聽 聽local oMenu
聽 聽
聽 聽DEFINE MENU oMenu RESOURCE 102
聽 聽
聽 聽REDEFINE MENUITEM ID 100 OF oMenu ACTION ShowDialog()

聽 聽REDEFINE MENUITEM ID 110 OF oMenu ACTION MsgAlert( "FWCE power!" )
聽 聽
return oMenu

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

function ShowDialog()

聽 聽local oDlg
聽 聽
聽 聽DEFINE DIALOG oDlg RESOURCE "test"
聽 聽
聽 聽REDEFINE BUTTON ID 1 OF oDlg ACTION oDlg:End() 聽// IDOK == 1
聽 聽
聽 聽ACTIVATE DIALOG oDlg CENTERED ;
聽 聽 聽ON INIT SetOKButton( oDlg:hWnd )
聽 聽 聽
聽 聽if oDlg:nResult == 1
聽 聽 聽 Msginfo( "Top-right ok button was pressed" )
聽 聽endif 聽 聽 
聽 聽
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
Posts: 105
Joined: Thu Oct 20, 2005 12:29 PM
Re: Boton cerrar en dialogo.
Posted: Wed Jul 07, 2010 03:43 PM

Antonio Gracias, pero ese ejemplo muestra el dialogo maximizado como si fuera una ventana, yo lo necesito mas peque帽o y no se como hacerlo.

Saludos.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Boton cerrar en dialogo.
Posted: Wed Jul 07, 2010 06:00 PM

Sim贸n,

Una posible soluci贸n ser铆a usar un di谩logo con el estilo m谩s b谩sico (sin titulo, ni botones, etc) y dibujar en 茅l lo que necesites 贸 quieras mostrar.

De todas formas, tu objetivo es solo quitar la "x" ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 105
Joined: Thu Oct 20, 2005 12:29 PM
Re: Boton cerrar en dialogo.
Posted: Thu Jul 08, 2010 04:03 PM

No quiero quitar la x quiero que salga el boton ok como en el msginfo().

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Boton cerrar en dialogo.
Posted: Fri Jul 09, 2010 05:26 AM

Sim贸n,

En el ejemplo anterior que te he mostrado, cambia esta l铆nea:

shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIZEDLGFULLSCREEN;

as铆:

shidi.dwFlags = SHIDIF_DONEBUTTON;

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion