PANEL - new window type

Moderator: Rathinagiri

Post Reply
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

PANEL - new window type

Post by l3whmg »

Hi friends,
I've tried to read about this new window type and it's use, but...
First of all I don't understand if I can use this new window type inside CHILD form.
After this, I've tried to use it but I receive an error during execution of my code.

I've included a sample prg and an error screenshot. I've defined/used form (with panel) one time as CHILD and one time as MODAL, but the error it's the same.

Many thanks in advantage
Attachments
PanelTest.zip
(34.29 KiB) Downloaded 327 times
Luigi from Italy
www.L3W.it
User avatar
gfilatov
Posts: 1057
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: PANEL - new window type

Post by gfilatov »

l3whmg wrote:Hi friends,
I've tried to read about this new window type and it's use, but...
First of all I don't understand if I can use this new window type inside CHILD form.
...
Many thanks in advantage
Hi,

Please try the following working sample with CHILD form usage:

Code: Select all

#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

 DEFINE TOOLBAR toolbar1 ;
  BUTTONSIZE 60,30 ;
  FONT "Arial" ;
  SIZE 10 ;
  FLAT ;
  BORDER
  BUTTON bt_exit ;
   CAPTION 'e&Xit' ;
   ACTION p001win.Hide ;
   SEPARATOR
 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
Hope that helps :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: PANEL - new window type

Post by l3whmg »

Hi Grigory,
many thanks! Work fine...with little trick :)

Best regards
Luigi from Italy
www.L3W.it
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: PANEL - new window type

Post by Roberto Lopez »

l3whmg wrote:Hi friends,
I've tried to read about this new window type and it's use, but...
First of all I don't understand if I can use this new window type inside CHILD form.
After this, I've tried to use it but I receive an error during execution of my code.

I've included a sample prg and an error screenshot. I've defined/used form (with panel) one time as CHILD and one time as MODAL, but the error it's the same.

Many thanks in advantage
Using ACTIVATE WINDOW ALL command, NOAUTORELEASE style is assumed for all windows (excepting main).

Panel windows can't have the autorelease style, because their 'embedded' nature.

I'll reinforce error checking to warn the user about this.

Thanks for reporting.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: PANEL - new window type

Post by Roberto Lopez »

Roberto Lopez wrote:
l3whmg wrote:Hi friends,
I've tried to read about this new window type and it's use, but...
First of all I don't understand if I can use this new window type inside CHILD form.
After this, I've tried to use it but I receive an error during execution of my code.

I've included a sample prg and an error screenshot. I've defined/used form (with panel) one time as CHILD and one time as MODAL, but the error it's the same.

Many thanks in advantage
Using ACTIVATE WINDOW ALL command, NOAUTORELEASE style is assumed for all windows (excepting main).

Panel windows can't have the autorelease style, because their 'embedded' nature.

I'll reinforce error checking to warn the user about this.

Thanks for reporting.
I've already fixed. Avoiding that Panel windows be double activated by ACTIVATE WINDOW ALL command.

I've found a problem with 'restore' method used by you (instead of 'show'). It not worked for non-visible windows.

Thanks again for reporting.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: PANEL - new window type

Post by l3whmg »

Hi Roberto,
many, many thanks to you forf your great job HMG!
Best regards
Luigi from Italy
www.L3W.it
Post Reply