Pressing ALT erasing parts of dialog

Pressing ALT erasing parts of dialog

Postby byte-one » Wed Nov 30, 2011 8:14 am

To supress erasing parts of the dialog when pressing ALT i make this change in control.prg

Code: Select all  Expand view
   case nMsg == WM_UPDATEUISTATE  // buttons, radios and checkboxes were erased when pressing ALT
           nResult = Super:HandleEvent( nMsg, nWParam, nLParam )
           if ::lTransparent //.and. ( ::IsKindOf( "TRADIO" ) .or. ::IsKindOf( "TCHECKBOX" ) )  //changed!
              ::oWnd:Refresh( .f. )
           endif
           return nResult
Last edited by byte-one on Wed Nov 30, 2011 10:28 am, edited 1 time in total.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Pressing ALT erases parts of dialog

Postby Antonio Linares » Wed Nov 30, 2011 8:36 am

Thanks! :-)
regards, saludos

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

Re: Pressing ALT erasing parts of dialog

Postby carlos vargas » Sun Dec 11, 2011 6:55 pm

Antonio, the mod work in dialog, but: in a dialog i have a folder, this have 3 dialogs, the first dialog have a chechbox, when press alt key the chechkbox is erasing :-(

i try this mod code, but no work.
can review please.

Code: Select all  Expand view

       case nMsg == WM_UPDATEUISTATE
               nResult = Super:HandleEvent( nMsg, nWParam, nLParam )
               if ::lTransparent
                  ::oWnd:Refresh( .f. )
               endif
               IF ::IsKindOf( "TFOLDER" )
                   nPage := ::nOption
                   ::aDialogs[ nPage ]:Refresh( .f. )
               ENDIF               
               endif
               return nResult
 

Image

Uploaded with ImageShack.us
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Pressing ALT erasing parts of dialog

Postby byte-one » Mon Dec 12, 2011 7:40 am

Please try without the group or change the order in the RC-file! Group should be before the other controls.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Pressing ALT erasing parts of dialog

Postby Antonio Linares » Mon Dec 12, 2011 9:20 am

Carlos,

Haz como te indica Günther a ver si asi queda bien, gracias! :-)
regards, saludos

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

Re: Pressing ALT erasing parts of dialog

Postby carlos vargas » Mon Dec 12, 2011 12:40 pm

Bueno, he probado con grupbox, sin grupbox, ponenindo el grupbox al inicio o al final del recurso, pero no cambia el hecho de que se borra el checkbox. :-(

salu2
Code: Select all  Expand view

   /*define dialogo*/
   DEFINE DIALOG oDlgE NAME "DLG_CLIENTESE" OF oDlg ICON GetIcon() FONT oFont2

   REDEFINE FOLDER oFolder;
        ID 101 OF oDlgE;
        PROMPTS "1.-Datos generales", "2.-Datos de fiador", "3.-Notas/Otros";
        DIALOGS "DLG_CLIENTESE1"    , "DLG_CLIENTESE2"    , "DLG_CLIENTESE3"

   /*define controles del page1*/
   REDEFINE GET      nNumCli                 ID 101 OF PAGE1 PICTURE "999999" WHEN FALSE
   REDEFINE GET      dFecIng                 ID 102 OF PAGE1 PICTURE "@DK"    VALID Clientes_ValidarFechaIngreso()
   REDEFINE GET      cNomCli                 ID 103 OF PAGE1 PICTURE "@!K"    VALID Validar_NoVacio( cNomCli )
   REDEFINE GET      cDomCli                 ID 104 OF PAGE1 PICTURE "@!K"    VALID Clientes_ValidarDomicilio()
   REDEFINE GET      cLugNac                 ID 105 OF PAGE1 PICTURE "@!K"
   REDEFINE GET      dFecNac                 ID 106 OF PAGE1 PICTURE "@DK"    VALID Clientes_ValidarFechaNac()
   REDEFINE GET      cCedCli                 ID 107 OF PAGE1 PICTURE "@!K"    VALID Clientes_ValidarCedula( lNuevo )
   REDEFINE GET      cTelCli                 ID 108 OF PAGE1 PICTURE "@!K"
   REDEFINE CHECKBOX lCliCas                 ID 109 OF PAGE1
   REDEFINE GET      cNomCon                 ID 110 OF PAGE1 PICTURE "@!K"

   REDEFINE GET      cActNeg                 ID 111 OF PAGE1 PICTURE "@!K"
   REDEFINE GET      cMatNeg                 ID 112 OF PAGE1 PICTURE "@!K"
   REDEFINE GET      cDirNeg                 ID 113 OF PAGE1 PICTURE "@!K" UPDATE
   REDEFINE GET      cTieNeg                 ID 114 OF PAGE1 PICTURE "@!K"
   REDEFINE GET      cNomCiu                 ID 115 OF PAGE1 WHEN FALSE UPDATE
   REDEFINE BUTTONBMP                        ID 116 OF PAGE1 ACTION Clientes_SeleccionarCiudad()       BITMAP "BMS_LUPA" WHEN !Empty( cNomCli )
   REDEFINE GET      cNomGes                 ID 117 OF PAGE1 WHEN FALSE UPDATE
   REDEFINE BUTTONBMP                        ID 118 OF PAGE1 ACTION Clientes_SeleccionarGestor()       BITMAP "BMS_LUPA" WHEN nNumCiu > 0
   REDEFINE GET      cNomRut                 ID 119 OF PAGE1 WHEN FALSE UPDATE
   REDEFINE BUTTONBMP                        ID 120 OF PAGE1 ACTION Clientes_SeleccionarRuta( lNuevo ) BITMAP "BMS_LUPA" WHEN nNumGes > 0 //nNumRut
   REDEFINE GET      cNomCob                 ID 121 OF PAGE1 WHEN FALSE UPDATE

   /*define controles del page2*/
   REDEFINE GET      cNomFia1                ID 101 OF PAGE2 PICTURE "@!K"
   REDEFINE GET      cDomFia1                ID 102 OF PAGE2 PICTURE "@!K" VALID Clientes_ValidarF1Domicilio()
   REDEFINE GET      cCedFia1                ID 103 OF PAGE2 PICTURE "@!K"
   REDEFINE GET      cTelFia1                ID 104 OF PAGE2 PICTURE "@!K"
   REDEFINE GET      cActNegF1               ID 105 OF PAGE2 PICTURE "@!K"
   REDEFINE GET      cMatNegF1               ID 106 OF PAGE2 PICTURE "@!K"
   REDEFINE GET      cDirNegF1               ID 107 OF PAGE2 PICTURE "@!K" UPDATE
   REDEFINE GET      cTieNegF1               ID 108 OF PAGE2 PICTURE "@!K"

   REDEFINE GET      cNomFia2                ID 109 OF PAGE2 PICTURE "@!K"
   REDEFINE GET      cDomFia2                ID 110 OF PAGE2 PICTURE "@!K" VALID Clientes_ValidarF2Domicilio()
   REDEFINE GET      cCedFia2                ID 111 OF PAGE2 PICTURE "@!K"
   REDEFINE GET      cTelFia2                ID 112 OF PAGE2 PICTURE "@!K"
   REDEFINE GET      cActNegF2               ID 113 OF PAGE2 PICTURE "@!K"
   REDEFINE GET      cMatNegF2               ID 114 OF PAGE2 PICTURE "@!K"
   REDEFINE GET      cDirNegF2               ID 115 OF PAGE2 PICTURE "@!K" UPDATE
   REDEFINE GET      cTieNegF2               ID 116 OF PAGE2 PICTURE "@!K"

   /*define controles del page3*/
   REDEFINE CHECKBOX lCliAct                 ID 101 OF PAGE3 ON CHANGE ( IIf( lCliAct, ( dFecDes := CToD(""), PAGE3:update() ), NIL ) )
   REDEFINE GET      dFecDes                 ID 102 OF PAGE3 PICTURE "@DK" WHEN !lCliAct UPDATE
   REDEFINE GET      cNotCli                 ID 103 OF PAGE3 MEMO

   REDEFINE BUTTON ID 201 OF oDlgE ACTION IIf( Clientes_Grabar( lNuevo ) .and. !lContinuar, oDlgE:END(), NIL )
   REDEFINE BUTTON ID 202 OF oDlgE ACTION oDlgE:END() CANCEL

   /*activa dialogo*/
   ACTIVATE DIALOG oDlgE CENTER

   oFont2:END()

   oBrw:SetFocus()

RETURN

 

Code: Select all  Expand view

DLG_CLIENTESE DIALOG 0, 0, 385, 334
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "Introdusca datos de cliente"
FONT 9, "Tahoma"
{
    CONTROL         "", 101, WC_TABCONTROL, WS_TABSTOP, 7, 7, 371, 301
    PUSHBUTTON      "&Aceptar", 201, 273, 313, 50, 14
    PUSHBUTTON      "&Cancelar", 202, 328, 313, 50, 14
}
DLG_CLIENTESE1 DIALOG 0, 0, 370, 284
STYLE DS_3DLOOK | DS_SETFONT | WS_VISIBLE | WS_CHILDWINDOW
FONT 9, "Tahoma"
{
    GROUPBOX        "Datos generales", IDC_STATIC, 7, 7, 356, 127, 0, WS_EX_TRANSPARENT
    GROUPBOX        "Datos del negocio del cliente (deudor)", IDC_STATIC, 7, 134, 356, 81, 0, WS_EX_TRANSPARENT
    GROUPBOX        "Otros", IDC_STATIC, 7, 216, 356, 61, 0, WS_EX_TRANSPARENT
    LTEXT           "Nº de cliente", IDC_STATIC, 14, 17, 53, 8, SS_LEFT
    LTEXT           "Fecha de ingreso:", IDC_STATIC, 226, 18, 67, 8, SS_LEFT
    LTEXT           "Nombres y apellidos", IDC_STATIC, 14, 33, 68, 8, SS_LEFT
    LTEXT           "Dirección domiciliar", IDC_STATIC, 14, 49, 68, 8, SS_LEFT
    LTEXT           "Lugar de nacimiento", IDC_STATIC, 14, 65, 68, 8, SS_LEFT
    RTEXT           "Fecha de nacimiento :", IDC_STATIC, 225, 65, 68, 8, SS_RIGHT
    LTEXT           "No. indentificación", IDC_STATIC, 15, 81, 68, 8, SS_LEFT
    LTEXT           "Teléfonos", IDC_STATIC, 14, 98, 68, 8, SS_LEFT
    LTEXT           "Nombre conyuge", IDC_STATIC, 14, 113, 68, 8, SS_LEFT
    LTEXT           "Actividad", IDC_STATIC, 15, 146, 68, 8, SS_LEFT
    LTEXT           "No. de matricula", IDC_STATIC, 15, 162, 68, 8, SS_LEFT
    LTEXT           "Dirección", IDC_STATIC, 15, 178, 68, 8, SS_LEFT
    LTEXT           "Tiempo de poseer el negocio", IDC_STATIC, 15, 194, 68, 17, SS_LEFT
    LTEXT           "Ciudad:", IDC_STATIC, 15, 225, 68, 8, SS_LEFT
    LTEXT           "Gestor:", IDC_STATIC, 15, 241, 68, 8, SS_LEFT
    LTEXT           "Zona cobro:", IDC_STATIC, 15, 257, 68, 8, SS_LEFT
    EDITTEXT        101, 87, 17, 48, 14, ES_RIGHT | ES_AUTOHSCROLL
    EDITTEXT        102, 297, 17, 56, 14, ES_AUTOHSCROLL
    EDITTEXT        103, 87, 33, 266, 14, ES_AUTOHSCROLL
    EDITTEXT        104, 87, 49, 266, 14, ES_AUTOHSCROLL
    EDITTEXT        105, 87, 65, 133, 14, ES_AUTOHSCROLL
    EDITTEXT        106, 297, 65, 56, 14, ES_AUTOHSCROLL
    EDITTEXT        107, 87, 81, 133, 14, ES_AUTOHSCROLL
    EDITTEXT        108, 87, 97, 133, 14, ES_AUTOHSCROLL
    CHECKBOX        "&Casado", 109, 297, 97, 56, 8
    EDITTEXT        110, 87, 113, 206, 14, ES_AUTOHSCROLL
    EDITTEXT        111, 88, 146, 266, 14, ES_AUTOHSCROLL
    EDITTEXT        112, 88, 162, 266, 14, ES_AUTOHSCROLL
    EDITTEXT        113, 88, 178, 266, 14, ES_AUTOHSCROLL
    EDITTEXT        114, 88, 194, 266, 14, ES_AUTOHSCROLL
    EDITTEXT        115, 88, 225, 118, 14, ES_AUTOHSCROLL
    PUSHBUTTON      "", 116, 207, 225, 14, 14
    EDITTEXT        117, 88, 241, 118, 14, ES_AUTOHSCROLL
    PUSHBUTTON      "", 118, 207, 241, 14, 14
    EDITTEXT        119, 88, 257, 118, 14, ES_AUTOHSCROLL
    PUSHBUTTON      "", 120, 207, 257, 14, 14
    EDITTEXT        121, 226, 257, 128, 14, ES_AUTOHSCROLL
}
 
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Pressing ALT erasing parts of dialog

Postby Antonio Linares » Mon Dec 12, 2011 8:27 pm

Carlos,

Vamos a empezar por un ejemplo sencillito para ver si podemos reproducir el error. Este ejemplo está funcionando bien aqui, por favor pruébalo, gracias

carlos.prg
Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local oDlg, oFld, lVal := .T.

   DEFINE DIALOG oDlg SIZE 400, 300

   @ 0.5, 1 FOLDER oFld PROMPTS "One", "Two", "Three" SIZE 190, 120

   @ 1, 1 CHECKBOX lVal PROMPT "Test" SIZE 80, 15 OF oFld:aDialogs[ 1 ]

   @ 7.3, 14 BUTTON "Ok" ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED

return nil


Image
regards, saludos

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

Re: Pressing ALT erasing parts of dialog

Postby carlos vargas » Mon Dec 12, 2011 11:44 pm

lo he probado con winxp y funciona correctamente, he modificado un poco el codigo, para incluir gets y manifest.
ahora que llege a la casa lo pruebo con win7 64 que es donde me ha dado el clavo.
te comentare en breve.

salu2

Code: Select all  Expand view

    #include "FiveWin.ch"

    function Main()

       local oDlg, oFld, lVal := .T., cVar := space(25), cVar2 := space(25)

       DEFINE DIALOG oDlg SIZE 400, 300

       @ 0.5, 1 FOLDER oFld PROMPTS "One", "Two", "Three" SIZE 190, 120

       @ 1, 1 GET      cVar                SIZE 80, 12 OF oFld:aDialogs[ 1 ]
       
       @ 3, 1 CHECKBOX lVal PROMPT "&Test" SIZE 80, 12 OF oFld:aDialogs[ 1 ]

       @ 5, 1 GET      cVar2               SIZE 80, 12 OF oFld:aDialogs[ 1 ]      

       @ 7.3, 14 BUTTON "&Ok" ACTION oDlg:End()

       ACTIVATE DIALOG oDlg CENTERED

    return nil

 

Code: Select all  Expand view

ico ICON .\..\ICONS\FiveWin.ico

#ifdef __FLAT__
  1 24 "WinXP/WindowsXP.Manifest"
#endif

#ifdef __64__
  1 24 "WinXP/WindowsXP.Manifest64"
#endif

 
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Pressing ALT erasing parts of dialog

Postby carlos vargas » Tue Dec 13, 2011 2:33 am

antonio, el mismo exe que funciona ok, en windows xp, en windows 7 64bits falla rotundamente.
solo queda el subrayado de "&Test" :-(

otra cosa antonio, es que el borde punteado la primera vez que se tiene foco no se muestra, las siguientes veces si funciona.

esto en winxp funciona muy bien, solo falla con win7, y solo en dialogos contenidos en folder, en dialogos simples
funciona tanto en winxp como en win7.

salu2

Image

Uploaded with ImageShack.us
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Pressing ALT erasing parts of dialog

Postby Antonio Linares » Tue Dec 13, 2011 7:06 am

Carlos,

La diferencia era el uso del manifest. Hay que hacer este pequeño cambio en control.prg:

Code: Select all  Expand view
     case nMsg == WM_UPDATEUISTATE  // buttons, radios and checkboxes were erased when pressing ALT
           nResult = Super:HandleEvent( nMsg, nWParam, nLParam )
           // if ::lTransparent
              ::oWnd:Refresh( .F. )
           // endif
           return nResult


Gracias! :-)
regards, saludos

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

Re: Pressing ALT erasing parts of dialog

Postby Antonio Linares » Tue Dec 13, 2011 7:10 am

Carlos,

De hecho regresamos al primer mensaje de esta conversación, solo que quitando la comprobación de transparente :-)

Code: Select all  Expand view
     case nMsg == WM_UPDATEUISTATE  // buttons, radios and checkboxes were erased when pressing ALT
           nResult = Super:HandleEvent( nMsg, nWParam, nLParam )
           if ::IsKindOf( "TRADIO" ) .or. ::IsKindOf( "TCHECKBOX" )
              ::oWnd:Refresh( .F. )
           endif  
           return nResult
regards, saludos

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

Re: Pressing ALT erasing parts of dialog

Postby carlos vargas » Tue Dec 13, 2011 3:09 pm

Excelente Antonio, se corrigio el error del borrado del control checkbox y radiobutton.
este bug tenia su tiempo, probe una version 2.8 de fwh y este ya lo tenia. :-)

Aun resta el error de que la primera vez que el control checkbox o radiobutton tiene
el foco, no muestra el borde punteado, esto cuando se usa windows 7 y el control esta en un
folder.

te repito que esto en winxp funciona bien, la falla solo se presenta en windows7

gracias antonio.

salu2
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Pressing ALT erasing parts of dialog

Postby carlos vargas » Tue Dec 13, 2011 3:41 pm

Antonio, como efecto no deseado, ahora al presionar ALT los controles say (sean estos redefinido o no) se ponen en negritas.
en el folder.
Image

Uploaded with ImageShack.us
Esto ocurre solamente si le hemos asignado un font al dialogo, pruebalo asignando el font y luego sin el font.

pruebalo con este ejemplo
(se usa el mismo rc del ejemplo anterior)

Code: Select all  Expand view

    #include "FiveWin.ch"

    function Main()

       local oDlg, oFnt, oFld, lVal := .T., cVar := space(25), cVar2 := space(25)

       DEFINE FONT oFnt NAME "Tahoma" SIZE 0, -12
       
       DEFINE DIALOG oDlg SIZE 400, 300 FONT oFnt  /*ANTONIO aca asignamos el font al dialogo, prueba con y sin*/

       @ 0.5, 1 FOLDER oFld PROMPTS "One", "Two", "Three" SIZE 190, 120

       @ 1, 1  SAY "Hola1" SIZE 25, 12 OF oFld:aDialogs[ 1 ]
       
       @ 1, 10 GET      cVar                SIZE 80, 12 OF oFld:aDialogs[ 1 ]
       
       @ 3, 10 CHECKBOX lVal PROMPT "&Test" SIZE 80, 12 OF oFld:aDialogs[ 1 ]

       @ 5, 1  SAY "Hola2" SIZE 25, 12 OF oFld:aDialogs[ 1 ]
       @ 5, 10 GET      cVar2               SIZE 80, 12 OF oFld:aDialogs[ 1 ]      

       @ 7.3, 14 BUTTON "&Ok" ACTION oDlg:End()

       ACTIVATE DIALOG oDlg CENTERED

    return nil

 
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Pressing ALT erasing parts of dialog

Postby carlos vargas » Tue Dec 13, 2011 6:39 pm

antonio, he logrado que me funcione, ya no muestra en bold los textos en los dialogos en un folder, tanto en xp como en w7

he modificado un poco y habilitado el metodo handlevent de la clase tcheckbox

si la version es xp entonces llamo al super:handlevent.
no creo que sea lo adecuado este codigo, pero te puede dar luz de donde este el problema, revisalo por favor.

Code: Select all  Expand view

#define WM_UPDATEUISTATE  0x0128

METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TCheckBox

   IF nMsg == WM_UPDATEUISTATE
      ::Refresh(.f.)
      RETURN NIL
   ENDIF

RETURN IIf( "XP" $ Upper( cWinVersion() ), Super:HandleEvent( nMsg, nWParam, nLParam ), NIL )
 
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Pressing ALT erasing parts of dialog

Postby carlos vargas » Tue Dec 13, 2011 7:33 pm

otra cosa Antonio.

cuando en XP o Win7 se tiene activado

Propiedades de pantalla->Apariencia->Efectos->Ocultar las letras subrayadas de acceso rapido hasta que presione la tecla ALT.


los controles checkbox y radiobuttons al obtener el foco la primera vez no muestra el borde punteado.

pero cuando esa propiedad esta activa.

ambos controles muestran correctamente el borde punteado, de ahi que muchas personas
reporte el problema y mucho otros indiquen que no tienen el problema.


ahi estaba el misterio.

ahora a saber que lo soluciona. :-)

disculpa la jodarria con esto, pero es para que el producto FWH quede cada dia mejor. :-)

salu2
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 6 guests