FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bug in TBtnBmp?
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TBtnBmp?
Posted: Sun Aug 04, 2013 09:30 PM
In the sample below, please click on the "Test" button and you will see the BtnBmp doesn't go away (while if you try with the Bitmap all is fine).

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


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL oCtl

    DEFINE DIALOG oDlg;
           SIZE 800, 600

//    @ 1, 1 BITMAP oCtl
    @ 1, 1 BTNBMP oCtl

    @ 7, 1 BUTTON "Test";
           ACTION oCtl:End()

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Bug in TBtnBmp?
Posted: Mon Aug 05, 2013 02:04 AM
Enrico,
Yes, it seems.
Code (fw): Select all Collapse
    LOCAL oDlg

    LOCAL oCtl

    LOCAL cVar := "Hola"
    LOCAL nVar := 1
    LOCAL lVar := .t.

    DEFINE DIALOG oDlg;
           SIZE 800, 600

//    @ 1, 1 BITMAP oCtl    //yes
    @ 1, 1 BTNBMP oCtl PROMPT "BtnBmp" SIZE 60,14 //NO
//    @ 1, 1 BUTTON oCtl PROMPT "Button"   //yes
//    @ 1, 1 SAY    oCtl PROMPT "HOLA"    //yes
//    @ 1, 1 CHECKBOX  oCtl VAR lVar      //yes
//    @ 1, 1 RADIO oCtl VAR nVar ITEMS "&One", "&Two" SIZE 150, 25  //yes
//    @ 1, 1 GET oCtl VAR cVAR SIZE 40,12  //yes
//    @ 1, 1 COMBOBOX oCtl VAR nVar ITEMS {"1","2","3"}   //yes


    @ 7, 1 BUTTON "Test";
           ACTION oCtl:End()

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TBtnBmp?
Posted: Wed Aug 07, 2013 02:17 PM

Any ideas? I think the problem is inside Destroy() method.

EMG

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Bug in TBtnBmp?
Posted: Wed Aug 07, 2013 06:02 PM
Code (fw): Select all Collapse
#include "Fivewin.ch"

FUNCTION MAIN()

    LOCAL oDlg, oCtl

    DEFINE DIALOG oDlg SIZE 800, 600

    // @ 1, 1 BITMAP oCtl
    @ 1, 1 BTNBMP oCtl PROMPT "Visible"

    /* // error
    @ 7, 1 BUTTON "Test";
           ACTION oCtl:End()
    */

    // Invisible
    @ 7, 1 BUTTON "Hide";
           ACTION( oCtl:Hide() )

    // Visible
    @ 9, 1 BUTTON "Show";
           ACTION( oCtl:Show() )

    @ 11, 1 BUTTON "&Exit" ;
           ACTION( oDlg:End() ) CANCEL UPDATE

    ACTIVATE DIALOG oDlg CENTER

RETURN NIL
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TBtnBmp?
Posted: Wed Aug 07, 2013 06:16 PM

João,

Thank you, but I'd want to End() it, not to just hide it.

EMG

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Bug in TBtnBmp?
Posted: Wed Aug 07, 2013 07:54 PM
Code (fw): Select all Collapse
#include "Fivewin.ch"

FUNCTION MAIN()

    LOCAL oDlg, oCtl

    DEFINE DIALOG oDlg SIZE 800, 600

    // @ 1, 1 BITMAP oCtl
    @ 1, 1 BTNBMP oCtl PROMPt "Visible"

    @ 3, 1 BUTTON "Test1";
           ACTION( oCtl:End(), oDlg:Refresh(), oDlg:UpDate() )

    @ 5, 1 BUTTON "Test2";
           ACTION( oCtl:Hide(), oCtl:End(), oDlg:Refresh(), oDlg:UpDate() )

    // Invisible
    @ 7, 1 BUTTON "Hide";
           ACTION( oCtl:Hide() )

    // Visible
    @ 9, 1 BUTTON "Show";
           ACTION( oCtl:Show() )

    @ 11, 1 BUTTON "&Exit" ;
           ACTION( oDlg:End() ) CANCEL UPDATE

    ACTIVATE DIALOG oDlg CENTER

RETURN NIL



João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TBtnBmp?
Posted: Wed Aug 07, 2013 08:38 PM

João,

you missed the point: there is a problem in TBtmBmp Destroy() method that prevents the control to End(). It needs to be fixed.

EMG

Continue the discussion