Converting app from 9.1D to OpenEdge - What became of the 9.1D function 'GetPanelFrame' in OE?

Hi All,

WinXP/Win7 ADM2:

Migrating one of my apps from 9.1D to OpenEdge. Hoping someone can tell me what became of the 9.1D function 'GetPanelFrame' in OE?

I'd been using it to determine the handle to the dynamic toolbar frame.

I'd then do some panel-frame size calculations and insert/manipulate toolbar buttons dynamically using 'CreateButton' function which requires the Panel Frame handle. See pseudo code below:

DEF VAR v-PanelFrameHdl AS HANDLE NO-UNDO.
DEF VAR v-Pix AS INT NO-UNDO.
DEF VAR v-Caption AS CHAR NO-UNDO.
DEF VAR v-OrigPnlWidth AS INT NO-UNDO.
DEF VAR v-CurPnlWidth AS INT NO-UNDO.
DEF VAR v-CurInsertPt AS INT NO-UNDO.
DEF VAR v-SepWidth AS INT INIT 2 NO-UNDO.
DEF VAR hButtHdl AS HANDLE NO-UNDO.
DEF VAR cProVersion AS CHAR NO-UNDO.

IF VALID-HANDLE(v-ToolBarHdl) THEN DO:

ASSIGN
cProVersion = PROVERSION
v-PanelFrameHdl = IF cProVersion BEGINS("9") THEN DYNAMIC-FUNCTION('GetPanelFrame':U) ELSE DYNAMIC-FUNCTION('GetPanelFrame':U)
v-OrigPnlWidth = v-PanelFrameHdl:WIDTH-PIXELS
v-CurPnlWidth = v-OrigPnlWidth
v-Caption = "Find "
+ DYNAMIC-FUNCTION("getTables" IN v-DataSrcHdl)
+ " record".

hButtHdl = DYNAMIC-FUNCTION(
"defineAction":U IN v-ToolBarHdl,
"FIND_REC",
"Name,Caption,Image,Link,Type,OnChoose",
"FIND_REC" + CHR(1) +
"Find Record" + CHR(1) +
"images/worldsearch.bmp" + CHR(1) +
"TableIO-Target" + CHR(1) +
"RUN" + CHR(1) +
"ip-FIND_REC"
).

ASSIGN
v-CurInsertPt = v-OrigPnlWidth
+ v-SepWidth
v-CurPnlWidth = v-CurPnlWidth
+ 16
+ (7 * v-SepWidth)
v-PanelFrameHdl:WIDTH-PIXELS = v-CurPnlWidth
v-Pix = v-CurInsertPt.

DYNAMIC-FUNCTION(
'createButton':U IN v-ToolBarHdl,
INPUT v-PanelFrameHdl,
INPUT-OUTPUT v-Pix,
INPUT "FIND_REC",
INPUT "Find",
INPUT v-Caption,
INPUT "images/worldsearch.bmp",
INPUT TRUE
).

Thanks!

Scott


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jurjen's picture

Re: converting 9.1D app to OE10

Hi, the error could be result of the test:

IF cProVersion BEGINS("9") 

because in OpenEdge, cProVersion begins "10" :-)
This bug is in several locations in ADM2 sourcecode. Progress support said they will not fix it.


Figured it out

Hi All,

Dontcha hate it when you figure something out immediately after "outing" yourself as not knowing. ;-)

Snippet below contains the correct code.

v-PanelFrameHdl = IF cProVersion BEGINS("9") THEN
DYNAMIC-FUNCTION('GetPanelFrame':U IN v-ToolBarHdl)
ELSE
DYNAMIC-FUNCTION('getContainerHandle':U IN v-ToolBarHdl).

In V9.xx the correct call is 'GetPanelFrame'.

In OE,'GetPanelFrame' became 'getContainerHandle'.

It all works just dandy now.

Thanks to Jurjen for responding so quickly.

Ciao