FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Ribbon - Rbbtn / CANCEL
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
Ribbon - Rbbtn / CANCEL
Posted: Fri Oct 18, 2013 02:27 PM

Estimados;
En un Dialog tengo botones RBbtn, entre ellos uno para Cerrar el Dialog. Tambien tengo el primer GET con condici贸n de validaci贸n.
El punto es que cuando hago clic en boton Cerrar, si el GET no cumple con la validaci贸n, el Dlg no se cierra.
O sea, el RbBtn no tiene la cl谩usula CANCEL.
Cual es la soluci贸n?
gracias

Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ribbon - Rbbtn / CANCEL
Posted: Fri Oct 18, 2013 03:29 PM

Mario,

oRBtn:lCancel := .T.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
Re: Ribbon - Rbbtn / CANCEL
Posted: Fri Oct 18, 2013 06:52 PM

muchas gracias!

Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
Re: Ribbon - Rbbtn / CANCEL
Posted: Mon Oct 21, 2013 12:23 PM
Antonio:
No cierra

Code (fw): Select all Collapse
#include "fivewin.ch"
#include "ribbon.ch"

procedure Main
local oDlg, ;
聽 聽 聽 oGet, ;
聽 聽 聽 oEsc, ;
聽 聽 聽 cNombres:= Space( 30 )

聽 聽SET RESOURCES TO "TstRbBtn.dll"

聽 聽DEFINE DIALOG oDlg RESOURCE "dlg_datos"

聽 聽REDEFINE GET oGet VAR cNombres ID 101 OF oDlg ;
聽 聽 聽 聽 聽 聽 ACTION Alert( "Abre Lista existente" ) ;
聽 聽 聽 聽 聽 聽 VALID if( !Empty( cNombres ), .T., ( Alert( "No cierra desde el boton" ), .f. ) )

聽 聽REDEFINE RBBTN oEsc PROMPT "Cerrar" ID 300 OF oDlg TRANSPARENT ;
聽 聽 聽 聽 聽 聽 ACTION oDlg:End()
聽 聽oEsc:lCancel:= .T.

聽 聽ACTIVATE DIALOG oDlg

// Fin

RC.
Code (fw): Select all Collapse
// Test Rnbtn - CANCEL

dlg_datos DIALOG 152, 59, 161, 51
STYLE 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
CAPTION "Datos..."
FONT 11, "Calibri"
{
聽EDITTEXT 101, 42, 9, 114, 10
聽RTEXT "Nombres:", -1, 7, 10, 33, 8
聽LTEXT "", 12, 104, 95, 32, 8
聽CONTROL "", 300, "TRBtn", 0 | WS_CHILD | WS_VISIBLE, 62, 29, 36, 18
}


Uso FWH 12.04
Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ribbon - Rbbtn / CANCEL
Posted: Mon Oct 21, 2013 06:37 PM
Mario
Modifica la clase TControl
Code (fw): Select all Collapse
METHOD KillFocus( hCtlFocus ) CLASS TControl

聽 聽local oWnd

聽 聽if ! Empty( hCtlFocus ) .and. ::bValid != nil .and. WndParents( hCtlFocus, ::hWnd ) .and. ;
聽 聽 聽 ( oWnd := oWndFromhWnd( hCtlFocus ) ) != nil .and. ;
聽 聽 聽 Upper( oWnd:Classname() ) $ "TBUTTON;TBTNBMP;TBUTTONBMP" .and. ;
聽 聽 聽 .../...


con

Code (fw): Select all Collapse
METHOD KillFocus( hCtlFocus ) CLASS TControl

聽 聽local oWnd

聽 聽if ! Empty( hCtlFocus ) .and. ::bValid != nil .and. WndParents( hCtlFocus, ::hWnd ) .and. ;
聽 聽 聽 ( oWnd := oWndFromhWnd( hCtlFocus ) ) != nil .and. ;
聽 聽 聽 Upper( oWnd:Classname() ) $ "TBUTTON;TBTNBMP;TBUTTONBMP;TRBTN" .and. ;

聽 聽 聽.../...


Yo lo he probado y funciona (con la version FWH 12.03)
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Ribbon - Rbbtn / CANCEL
Posted: Mon Oct 21, 2013 06:42 PM

Antonio, quizas en la actual habr铆a que a帽adirlo igual

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
Re: Ribbon - Rbbtn / CANCEL
Posted: Tue Oct 22, 2013 12:17 PM

Cristobal;
Muchas gracias. Probar茅 tu propuesta

Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ribbon - Rbbtn / CANCEL
Posted: Tue Oct 22, 2013 01:48 PM

Cristobal,

A帽adido para FWH 13.09, muchas gracias! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion