I tried to implement a panel window for the first time, wanting to show/hide it by code.
Modifying an old post example, my attempts failed to compile. i have included the
sample code with my attempts at hiding shown within /*....*/
Is it possible to Hide/Show a panel window?
Thanks for looking at my post. More thanks if there is a solution.
#include "hmg.ch"
FUNCTION main()
p000_Define()
p001_Define()
ACTIVATE WINDOW p001win, p000win
RETURN NIL
/************************************************************
* Main form definition
************************************************************/
STATIC FUNCTION p000_Define()
DEFINE WINDOW p000win ;
AT 0,0 ;
WIDTH 860 ;
HEIGHT 645 ;
TITLE 'Panel tester' ;
WINDOWTYPE MAIN ;
FONTNAME "Arial" FONTSIZE 12
DEFINE MAIN MENU
DEFINE POPUP '&File'
MENUITEM 'e&Xit' ACTION p000win.Release
END POPUP
DEFINE POPUP '&Open Form'
MENUITEM '&Do' ACTION p000_OpenForm()
END POPUP
END MENU
END WINDOW
p000win.Center
RETURN NIL
/************************************************************
* Sub (and panel) form definition
************************************************************/
STATIC FUNCTION p001_Define()
DEFINE WINDOW p001win ;
AT 0,0 ;
WIDTH 700 ;
HEIGHT 525 ;
TITLE 'Sub Form' ;
WINDOWTYPE CHILD ;
NOAUTORELEASE ;
ONINIT p001win.Hide ;
FONTNAME "Arial" FONTSIZE 12
ON Key ALT+C of p001win ACTION {||(win_2.visible:=.F.)} //win_2.HIDE does not work either
DEFINE TOOLBAR toolbar1 ;
BUTTONSIZE 60,30 ;
FONT "Arial" ;
SIZE 10 ;
FLAT ;
BORDER
BUTTON bt_exit ;
CAPTION 'e&Xit' ;
ACTION p001win.Hide ;
SEPARATOR
/*
BUTTON bt_hide ;
CAPTION '&Hide_Panel' ;
ACTION poo1win.win_2.Hide ;
SEPARATOR
BUTTON bt_SHOW ;
CAPTION '&Show_Panel' ;
ACTION Win_2.Hide ;
*/
END TOOLBAR
DEFINE WINDOW Win_2 ;
ROW 80 ;
COL 30 ;
WIDTH 300 ;
HEIGHT 200 ;
VIRTUALWIDTH 400 ;
VIRTUALHEIGHT 400 ;
WINDOWTYPE PANEL
DEFINE LABEL lb_label1
ROW 10
COL 10
VALUE 'Panel window...'
WIDTH 300
END LABEL
END WINDOW
END WINDOW
p001win.Center
RETURN NIL
/************************************************************
* Sub (and panel) form open
************************************************************/
STATIC FUNCTION p000_OpenForm()
p001win.Show
p001win.Setfocus
RETURN NIL