Kbase 17714: Demo code for Videosoft's VSFlexGrid ActiveX Control
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
GOAL:
Demo code for Videosoft's VSFlexGrid ActiveX Control
FACT(s) (Environment):
Windows 32-bit
FIX:
The code example in this knowledgebase is for informational purposes only. Specific questions about which ActiveX objects or properties/methods within an object would be best suited to a specific design goals, please consult the ActiveX object vendor.
The following code is a conversion of Videosoft's "Outline Demo" from their online help file into Progress syntax (8.2 SmartObject).
This code has been tested on WinNT 4.0 Workstation using version 3.0 of Videosoft's VSFLEX ActiveX Control.
/* The following code goes into the definitions section */
DEFINE VARIABLE comFlexArray AS COM-HANDLE NO-UNDO.
/* The following procedure replaces the standard local-exit */
PROCEDURE local-exit:
RELEASE OBJECT comFlexArray.
APPLY 'CLOSE' TO THIS-PROCEDURE.
RETURN.
END PROCEDURE.
/* The following procedure replaces the standard local-initialize */
PROCEDURE local-initialize:
/* Code placed here will execute PRIOR to standard behavior. */
/* Dispatch standard ADM method. */
RUN dispatch IN THIS-PROCEDURE ('initialize').
/* Code placed here will execute AFTER standard behavior. */
ASSIGN comFlexArray = chCtrlFrame:vsFlexArray
comFlexArray:Cols = 3
comFlexArray:ExtendLastCol = True
comFlexArray:FormatString = '|Token |Setting'
comFlexArray:OutlineBar = 1
comFlexArray:Rows = 1
comFlexArray:SubtotalPosition = 1.
RUN AddOutline IN THIS-PROCEDURE ('WIN.INI').
RUN AddOutline IN THIS-PROCEDURE ('SYSTEM.INI').
RUN AddOutline IN THIS-PROCEDURE ('VB.INI').
comFlexArray:Outline(0).
END PROCEDURE.
/* The following procedure should be added */
PROCEDURE AddOutline:
DEFINE INPUT PARAMETER chrIniFile AS CHARACTER NO-UNDO.
DEFINE VARIABLE chrLine AS CHARACTER NO-UNDO.
DEFINE VARIABLE chrItem AS CHARACTER NO-UNDO.
DEFINE VARIABLE intPos AS INTEGER NO-UNDO.
comFlexArray:AddItem('~t' + chrIniFile).
comFlexArray:Select(comFlexArray:Rows - 1, 1).
comFlexArray:IsSubtotal(comFlexArray:Rows - 1) = True.
comFlexArray:CellFontBold = True.
INPUT FROM VALUE('C:\WINNT\' + chrIniFile).
REPEAT:
IMPORT UNFORMATTED chrLine.
IF SUBSTRING(chrLine,1,1) = '[' THEN
DO:
comFlexArray:AddItem('~t' + ' ' + SUBSTRING(chrLine,2,
(LENGTH(chrLine) - 2))).
comFlexArray:IsSubtotal(comFlexArray:Rows - 1) = True.
comFlexArray:RowData(comFlexArray:Rows - 1) = 1.
comFlexArray:Select(comFlexArray:Rows - 1, 1).
comFlexArray:CellFontBold = True.
END.
ELSE
DO:
ASSIGN intPos = INDEX(chrLine,'=').
IF intPos 0 THEN
DO:
chrItem = '~t' +
' ' +
SUBSTRING(chrLine,1,(intPos - 1)) +
'~t' +
SUBSTRING(chrLine,(intPos + 1),-1).
comFlexArray:AddItem(chrItem).
END.
END.
END.
INPUT CLOSE.
END PROCEDURE.