Windowtype Panel issues.

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
pemedina
Posts: 1
Joined: Wed Sep 14, 2011 3:46 pm

Windowtype Panel issues.

Post by pemedina »

Hello:

I am having an issue with hmg, and i am not sure if it's a feature, a bug, or wrong coding. I have a complex form with around 200 fields. It is divided in sections and each section is represented by a tab. Now, some of the sections can't be placed in a single screen (the tab container) so i tried to implement a panel window inside a tab (not on EVERY tab) just tab N.

I've found here in the forum a bit of code that implements a panel window so i played with it . Code is below:

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 TAB Tab_1 AT 60 , 180 WIDTH 800 HEIGHT 520 VALUE 1 TOOLTIP "" FLAT ON CHANGE Nil
    PAGE "P1"
    END PAGE

    PAGE "P2"
    END PAGE

    PAGE "P3"
      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 PAGE
    END TAB
  END WINDOW
  p001win.Center
RETURN NIL

/************************************************************
* Sub (and panel) form open
************************************************************/
STATIC FUNCTION p000_OpenForm()
p001win.Show
p001win.Setfocus
RETURN NIL
so windows "Win_2" is defined inside page "P3" of tab "Tab_1"

When i run the program i can see the panel is displayed on 1st tab of Tab_1 (i could think that is ok as it's loaded with parent window but then i expect it to be present on all tabs) . It is not. Just in tab 1. So i click on P3 and there's my panel with the label inside. But then i go back to P1 and my window panel isn't there. Si it looks like it is displayed only the first time, then it's gone.

If you compile the snippet you will see the issue i am experiencing

My main goal is to make the window Win_2 to be displayed ONLY in P3 , and my doubt is about the weird behaviour when form is loaded.

I am running 3.0.39 (Test 2011-09-12) (download from this forum)
Any help will be appreciated.

Thanks,
Pablo
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Windowtype Panel issues.

Post by andyglezl »

Hola a todos

Estoy probando "Window Panel" y me encontre con un problema que el siguiente Post detalla exactamente lo
que me pasa.

El autor "pemedina" comenta lo que estaba usando "I am running 3.0.39 (Test 2011-09-12)" y no recibió ninguna
respuesta en ese entonces, me pregunto si a la fecha alguien ya lo probó también y haya encontrado la solución.

Yo estoy compilando con la Versión 3.0.46

Gracias
--------------------------------------------------------------------------------
Hi all

I'm testing "Window Pane" and I found a problem the next post detailing exactly what
I passed.

The author "pemedina" says what he was using "I am running 3.0.39 (Test 12.09.2011)" and received no
response at the time, I wonder if the date someone already tried it too and have found the solution.

I'm compiling with Version 3.0.46

thanks
Attachments
WindowPanel.jpg
WindowPanel.jpg (110 KiB) Viewed 2515 times
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Windowtype Panel issues.

Post by andyglezl »

Por lo visto no hay solución...

---------------------------------------------------------------------
Hi Pablo,

> May be i'm missing something obvious but that behaviour doesn't look correct.
You are right!
I confirm also that the PANEL window is moved wrongly.
This behaviour was borrowed from Official HMG source "AS IS".

I'm open for any contribution / fixes on this problem as always.
Sorry for missing solution...
--
Kind Regards,
Grigory Filatov
------------------------------------------------------------------
Andrés González López
Desde Guadalajara, Jalisco. México.
Post Reply