1261
|
Mask for Floating-Point Numbers (Emglish Style: . as Decimal, , as Grouping Separator)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn
LOCAL oEditor
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:DrawGridLines := -2/*exRowLines*/
oGrid:GridLineStyle := 48/*exGridLinesSolid*/
oGrid:SetProperty("SelForeColor",oGrid:ForeColor())
oGrid:SetProperty("SelBackColor",oGrid:BackColor())
oGrid:ShowFocusRect := .F.
oColumn := oGrid:Columns():Add("Float(English-style)")
oColumn:SortType := 1/*SortNumeric*/
oColumn:FormatColumn := "value format `3`"
oColumn:HeaderAlignment := 2/*RightAlignment*/
oColumn:Alignment := 2/*RightAlignment*/
oEditor := oColumn:Editor()
oEditor:EditType := 8/*MaskType*/
oEditor:Mask := "!999,999,990.000;;;float,right,negative,grouping=\,,decimal=."
oItems := oGrid:Items()
oItems:AddItem(192278.12)
oItems:AddItem(2829.7)
oItems:AddItem(7391.55)
oItems:AddItem(50812.23)
oItems:AddItem(913.04)
oItems:AddItem(127500.88)
oItems:AddItem(62.19)
oItems:AddItem(1)
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1260
|
Mask for Floating-Point Numbers (German Style: , as Decimal, . as Grouping Separator)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn
LOCAL oEditor
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:DrawGridLines := -2/*exRowLines*/
oGrid:GridLineStyle := 48/*exGridLinesSolid*/
oGrid:SetProperty("SelForeColor",oGrid:ForeColor())
oGrid:SetProperty("SelBackColor",oGrid:BackColor())
oGrid:ShowFocusRect := .F.
oColumn := oGrid:Columns():Add("Float(German-style)")
oColumn:SortType := 1/*SortNumeric*/
oColumn:FormatColumn := "value format `3`"
oColumn:HeaderAlignment := 2/*RightAlignment*/
oColumn:Alignment := 2/*RightAlignment*/
oEditor := oColumn:Editor()
oEditor:EditType := 8/*MaskType*/
oEditor:Mask := "!999.999.990,000;;;float,right,grouping=.,decimal=\,"
oItems := oGrid:Items()
oItems:AddItem(192278.12)
oItems:AddItem(2829.7)
oItems:AddItem(7391.55)
oItems:AddItem(50812.23)
oItems:AddItem(913.04)
oItems:AddItem(127500.88)
oItems:AddItem(62.19)
oItems:AddItem(1)
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1259
|
Locks the first visible column on the left and the last visible column on the right

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL rs
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:ColumnAutoResize := .F.
oGrid:SetProperty("BackColorLock",AutomationTranslateColor( GraMakeRGBColor ( { 192,192,192 } ) , .F. ))
oGrid:GridLineStyle := 48/*exGridLinesSolid*/
oGrid:DrawGridLines := 2/*exVLines*/
oGrid:HeaderAppearance := 4/*Etched*/
rs := CreateObject("ADOR.Recordset")
rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.mdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
oGrid:DataSource := rs
oGrid:CountLockedColumns := 17
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1258
|
Lock the column on the right

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL rs
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:ColumnAutoResize := .F.
oGrid:SetProperty("BackColorLock",AutomationTranslateColor( GraMakeRGBColor ( { 192,192,192 } ) , .F. ))
oGrid:GridLineStyle := 48/*exGridLinesSolid*/
oGrid:DrawGridLines := 2/*exVLines*/
oGrid:HeaderAppearance := 4/*Etched*/
rs := CreateObject("ADOR.Recordset")
rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.mdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
oGrid:DataSource := rs
oGrid:CountLockedColumns := 16
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1257
|
Lock the column on the left

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL rs
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:ColumnAutoResize := .F.
oGrid:SetProperty("BackColorLock",AutomationTranslateColor( GraMakeRGBColor ( { 192,192,192 } ) , .F. ))
oGrid:GridLineStyle := 48/*exGridLinesSolid*/
oGrid:DrawGridLines := 2/*exVLines*/
oGrid:HeaderAppearance := 4/*Etched*/
rs := CreateObject("ADOR.Recordset")
rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.mdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
oGrid:DataSource := rs
oGrid:CountLockedColumns := 1
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1256
|
Update the item's lock state - pinning it to the top, bottom, or making it scrollable

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:Columns():Add("Column")
oItems := oGrid:Items()
oItems:AddItem("un-locked item")
oItems:SetProperty("LockItem",oItems:AddItem("top-locked item"),-1/*exLockTop*/)
oItems:SetProperty("LockItem",oItems:AddItem("bottom-locked item"),1/*exLockBottom*/)
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1255
|
The Change event is called before changing the value. Is there any event such as Changed that is called after updating the cell's value
PROCEDURE OnChanged(oGrid, Item, ColIndex)
DevOut( Transform(oGrid:Items:CellValue(Item,ColIndex),"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:Changed := {|Item, ColIndex| OnChanged(oGrid, Item, ColIndex)} /*Occurs after the user has changed the content of a cell.*/
oGrid:BeginUpdate()
oGrid:Columns():Add("Edit"):Editor():EditType := 1/*EditType*/
oGrid:Items():AddItem("Item 1")
oGrid:Items():AddItem("Item 2")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1254
|
How can I reposition the +/- (expand/collapse) icon to show as "number, icon, text" (sample 2)
PROCEDURE OnAnchorClick(oGrid, AnchorID, Options)
LOCAL oItems
LOCAL exp,i
i := oGrid:FormatABC("int(value)",AnchorID)
oItems := oGrid:Items()
i := oItems:ItemByIndex(i)
exp := oItems:ExpandItem(i)
oItems:SetProperty("ExpandItem",i,.F.)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn
LOCAL oColumns
LOCAL oEditor
LOCAL oItems
LOCAL h,hRoot
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:AnchorClick := {|AnchorID, Options| OnAnchorClick(oGrid, AnchorID, Options)} /*Occurs when an anchor element is clicked.*/
oGrid:BeginUpdate()
oGrid:SetProperty("HTMLPicture","expand","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYc7YYBY5vVBkiIYOhFLB0KZvMx0O5hORlABQMJpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyxgjsRzEKv1TqtXrNbrtfsIAwgASAHAGShQwGQzGABUGEzudAqgyWdSmWw2Fw+sABSHI4AGH1XAGAxGAwywlI6eRqjGi1YuaJJEIJUHBPYqSJYKQAwCBDKbBPbncBibrUKQjGLFQo+TBFfR5GaUAR/KbGICyRxsiCOQClgdJxGoMpkGycpdDqUZ0EoJQJHYVoWCSCA4kEbRlHKRwJiYcYCH0PBNB2JwYCaCRsGcE8LDyfZKg+U59EsAZMlQCgJkcEA9CsywkiKJwiFcIQwEEgI=")
oGrid:SetProperty("HTMLPicture","collapse","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYU7YQBCooJSAiIYOhFLB0KZvMx0O5hORlABQMJpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzyO13dGEAGYzWcqlWrFarlesA3AGcSAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWISpVLiXT5MrxiJyJJEIJUHBPYqSXYOQAgBgAB6jJwufxxX7YYhdYhFCSsSwSC4uMLoQajNJAG8QgZAgSIqGMCwRBkAJDicGwuiMeoHGeaRFlAU5qDwQQ6A+CYnlgPQeisGJfl4AJYhsRISjQYwJHIcpmmALAtlMEpkE4YBREmEpPBAARdicSw8AES5fi+fI5g+PpcAA" +;
"UJKgyCYknaZRrssJIiicIhXCEMBBICA==")
oGrid:SetProperty("HTMLPicture","empty","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYE7YABNTWRIJiIYOhFLB0KZvMx0O5hORlABQMJpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyy/O13dGEAGYzWcqlWrFarlesA3AGcSAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWYSvDpndpkQ9xhRTJJEIJUHBPdqSGIKYAwBgDUpCfytH57FqoVaTKQTGS0DJ6cDBDzOGwIfANHMIxJDmf5CFIAxwA4Q5HEQVJlEWRxnBkMANjsPoqBSEAElkfZ5CMFJMHCC52BALBGjkDpHCuXIAB2bQdEGaQgFIbbLCSIonCIVwhDAQSAg==")
oGrid:HeaderVisible := .F.
oGrid:HasLines := 0/*exNoLine*/
oGrid:HasButtons := 0/*exNoButtons*/
oGrid:Indent := 12
oGrid:DefaultItemHeight := 24
oGrid:DrawGridLines := 1/*exHLines*/
oGrid:GridLineStyle := 48/*exGridLinesSolid*/
oGrid:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 204,204,204 } ) , .F. ))
oGrid:ShowFocusRect := .F.
oGrid:ExpandOnDblClick := .F.
oGrid:ExpandOnKeys := .F.
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Item")
oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
oColumn:FormatColumn := "(len(parent(1 index ``)) ? (`<b><fgcolor gray>` + (1 pos ``) + `. ` + `</fgcolor></b>` + (%CC0 ? (`<a ` + (0 index ``) + `>`) : ``) + `<img>` + (%CC0 ? (not %CX0 ? `expand` : `collapse`) : `empty`) + `:16</img>` + (%CC0 ? (`</a>`) : ``)) : ``) + ` ` + value"
oEditor := oColumn:Editor()
oEditor:EditType := 1/*EditType*/
oEditor:SetProperty("Option",116/*exEditorAdjustPos*/,"32 4 -4 -4")
oItems := oGrid:Items()
hRoot := oItems:AddItem("ACME Corporation")
oItems:SetProperty("SelectableItem",hRoot,.F.)
oItems:SetProperty("ExpandItem",hRoot,.T.)
h := oItems:InsertItem(hRoot,,"Management")
oItems:InsertItem(h,,"CEO - Alice Brown")
oItems:InsertItem(h,,"COO - James Lee")
h := oItems:InsertItem(hRoot,,"HR Department")
oItems:InsertItem(h,,"Recruiter - Jane Smith")
oItems:InsertItem(h,,"HR Assistant - Bob Green")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:InsertItem(h,,"Engineering")
oItems:InsertItem(h,,"Software Team")
h := oItems:InsertItem(h,,"Lead Developer - Mark H.")
oItems:InsertItem(h,,"Frontend Dev - Emily R.")
oItems:InsertItem(h,,"Backend Dev - Tom W.")
oItems:InsertItem(hRoot,,"QA Team")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1253
|
How can I reposition the +/- (expand/collapse) icon to show as "number, icon, text" (sample 1)

PROCEDURE OnAnchorClick(oGrid, AnchorID, Options)
LOCAL oItems
LOCAL exp,i
i := oGrid:FormatABC("int(value)",AnchorID)
oItems := oGrid:Items()
i := oItems:ItemByIndex(i)
exp := oItems:ExpandItem(i)
oItems:SetProperty("ExpandItem",i,.F.)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn
LOCAL oColumns
LOCAL oItems
LOCAL h,hRoot
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:AnchorClick := {|AnchorID, Options| OnAnchorClick(oGrid, AnchorID, Options)} /*Occurs when an anchor element is clicked.*/
oGrid:BeginUpdate()
oGrid:SetProperty("HTMLPicture","expand","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYc7YYBY5vVBkiIYOhFLB0KZvMx0O5hORlABQMJpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyxgjsRzEKv1TqtXrNbrtfsIAwgASAHAGShQwGQzGABUGEzudAqgyWdSmWw2Fw+sABSHI4AGH1XAGAxGAwywlI6eRqjGi1YuaJJEIJUHBPYqSJYKQAwCBDKbBPbncBibrUKQjGLFQo+TBFfR5GaUAR/KbGICyRxsiCOQClgdJxGoMpkGycpdDqUZ0EoJQJHYVoWCSCA4kEbRlHKRwJiYcYCH0PBNB2JwYCaCRsGcE8LDyfZKg+U59EsAZMlQCgJkcEA9CsywkiKJwiFcIQwEEgI=")
oGrid:SetProperty("HTMLPicture","collapse","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYU7YQBCooJSAiIYOhFLB0KZvMx0O5hORlABQMJpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzyO13dGEAGYzWcqlWrFarlesA3AGcSAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWISpVLiXT5MrxiJyJJEIJUHBPYqSXYOQAgBgAB6jJwufxxX7YYhdYhFCSsSwSC4uMLoQajNJAG8QgZAgSIqGMCwRBkAJDicGwuiMeoHGeaRFlAU5qDwQQ6A+CYnlgPQeisGJfl4AJYhsRISjQYwJHIcpmmALAtlMEpkE4YBREmEpPBAARdicSw8AES5fi+fI5g+PpcAA" +;
"UJKgyCYknaZRrssJIiicIhXCEMBBICA==")
oGrid:HeaderVisible := .F.
oGrid:HasLines := 0/*exNoLine*/
oGrid:HasButtons := 0/*exNoButtons*/
oGrid:Indent := 12
oGrid:DefaultItemHeight := 24
oGrid:DrawGridLines := 1/*exHLines*/
oGrid:GridLineStyle := 48/*exGridLinesSolid*/
oGrid:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 204,204,204 } ) , .F. ))
oGrid:ShowFocusRect := .F.
oGrid:ExpandOnDblClick := .F.
oGrid:ExpandOnKeys := .F.
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Item")
oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
oColumn:FormatColumn := "(len(parent(1 index ``)) ? (`<b><fgcolor gray>` + (1 pos ``) + `. ` + `</fgcolor></b>` + `<a ` + (0 index ``) + `><img>` + (%CC0 ? (not %CX0 ? `expand` : `collapse`) : ``) + `:16</img></a>`) : ``) + ` ` + value"
oItems := oGrid:Items()
hRoot := oItems:AddItem("ACME Corporation")
oItems:SetProperty("SelectableItem",hRoot,.F.)
oItems:SetProperty("ExpandItem",hRoot,.T.)
h := oItems:InsertItem(hRoot,,"Management")
oItems:InsertItem(h,,"CEO - Alice Brown")
oItems:InsertItem(h,,"COO - James Lee")
h := oItems:InsertItem(hRoot,,"HR Department")
oItems:InsertItem(h,,"Recruiter - Jane Smith")
oItems:InsertItem(h,,"HR Assistant - Bob Green")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:InsertItem(h,,"Engineering")
oItems:InsertItem(h,,"Software Team")
h := oItems:InsertItem(h,,"Lead Developer - Mark H.")
oItems:InsertItem(h,,"Frontend Dev - Emily R.")
oItems:InsertItem(h,,"Backend Dev - Tom W.")
oItems:InsertItem(hRoot,,"QA Team")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1252
|
Expandable bullet list

PROCEDURE OnAnchorClick(oGrid, AnchorID, Options)
LOCAL oItems
LOCAL exp,i
i := oGrid:FormatABC("int(value)",AnchorID)
oItems := oGrid:Items()
i := oItems:ItemByIndex(i)
exp := oItems:ExpandItem(i)
oItems:SetProperty("ExpandItem",i,.F.)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn
LOCAL oColumns
LOCAL oEditor
LOCAL oItems
LOCAL h,hRoot
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:AnchorClick := {|AnchorID, Options| OnAnchorClick(oGrid, AnchorID, Options)} /*Occurs when an anchor element is clicked.*/
oGrid:BeginUpdate()
oGrid:SetProperty("HTMLPicture","expand","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYM7YIBXCRNbtiIYOhFLB0KZvMx0O5hORlABQMJpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzZO13dGEAGYzWcqlWrFarlesA3AGcSAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWNa6awbST7DBTiLyJJEIJUHBPUqSGJuYYwCAES5pBiQfyEX4QKAFH6QSihJQ/GZlET1FhIcgGnUdoVHMmxajSIghlMKhsGiAAFggQ5dmKcRHEUEhbFAFQBgacABmAAJgAAcAJkAZgNjUcwDFecYcD8QoIDsGJjD6aYaGyHI7mqLRfgGfBcg+TYggkEhakQThtFsEpAE2" +;
"Xh7goSIJiSHp6haKgPGOXx3j+c5hiKLpri6JAPHWYJREuFJkBCYxcFeYS7ikJQzG0ZIVGKMBYGsVwXDWVQHjqfpjAoYpyE4Z5vH2YoHDkZwzkkUxHC8pwCgifIHBCdk4GMLQVmcXJVhicxWi4IIUiKSQ1A8cBUj+eBEGCFQlFSIophiPRkFAWBLFALhwm+HhKjARpmgSGwNn4AIUCcZZUFEKoVmwywkiKJwiFcIQwEEgI")
oGrid:SetProperty("HTMLPicture","collapse","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYM7YIBXCRNbtiIYOhFLB0KZvMx0O5hORlABQMJpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzZO13dGEAGYzWcqlWrFarlesA3AGcSAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWNa6awbST7DBTiLZJJEIJUHBPdpSGKOAQxCAzGhIBKfbAvUBsSIPbiVMhLTxJPK3banJB0N5sA8VQRlmCRKjSCRaAIOgCiORISiWaI0DYLJPBYJBxB+LAqAMBRgAsIABjAAhYAOEB5kKDQ5kGZoaCaL5vH2KoEDCbpbDaWRrE8SopE+AA/DcMoZkgAgkhKERDlcdYEHA" +;
"JRzg4IpyCAKRyl6HZLGONwMEMb5clwWB3n2CZki6FoWC4cwQCbGYukKwhiAwOp3HIEJFGCNBGDyLArE8R56n4RUnlOShHGcXJdgcKQlCOSRdEcLw8DmAoInyexvFeMRGG0DARmsbRZmsfRxleFZeHoD4eEKKRxGmPANgAC5xDAWpYHMW4uCGywkiKJwiFcIQwEEgI")
oGrid:HeaderVisible := .F.
oGrid:HasLines := 0/*exNoLine*/
oGrid:HasButtons := 0/*exNoButtons*/
oGrid:Indent := 12
oGrid:DefaultItemHeight := 24
oGrid:DrawGridLines := 1/*exHLines*/
oGrid:GridLineStyle := 48/*exGridLinesSolid*/
oGrid:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 204,204,204 } ) , .F. ))
oGrid:ShowFocusRect := .F.
oGrid:ExpandOnDblClick := .F.
oGrid:ExpandOnKeys := .F.
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Item")
oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
oColumn:FormatColumn := "(len(parent(1 index ``)) ? (`<b><fgcolor gray>` + (1 pos ``) + `. ` + `</fgcolor></b>` + `<a ` + (0 index ``) + `><img>` + (%CC0 ? (not %CX0 ? `expand` : `collapse`) : `collapse`) + `:16</img></a>`) : ``) + ` ` + value"
oEditor := oColumn:Editor()
oEditor:EditType := 1/*EditType*/
oEditor:SetProperty("Option",116/*exEditorAdjustPos*/,"32D 4D -4D -4D")
oItems := oGrid:Items()
hRoot := oItems:AddItem("ACME Corporation")
oItems:SetProperty("SelectableItem",hRoot,.F.)
oItems:SetProperty("ExpandItem",hRoot,.T.)
h := oItems:InsertItem(hRoot,,"Management")
oItems:InsertItem(h,,"CEO - Alice Brown")
oItems:InsertItem(h,,"COO - James Lee")
h := oItems:InsertItem(hRoot,,"HR Department")
oItems:InsertItem(h,,"Recruiter - Jane Smith")
oItems:InsertItem(h,,"HR Assistant - Bob Green")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:InsertItem(h,,"Engineering")
oItems:InsertItem(h,,"Software Team")
h := oItems:InsertItem(h,,"Lead Developer - Mark H.")
oItems:InsertItem(h,,"Frontend Dev - Emily R.")
oItems:InsertItem(h,,"Backend Dev - Tom W.")
oItems:InsertItem(hRoot,,"QA Team")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1251
|
Does grouping support multi-column sorting

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:SingleSort := .F.
oGrid:HeaderVisible := .F.
oGrid:DrawGridLines := -2/*exRowLines*/
oGrid:GridLineStyle := 48/*exGridLinesSolid*/
oGrid:AllowGroupBy := .T.
oGrid:Columns():Add("Prefix")
oGrid:Columns():Add("Region")
oGrid:Columns():Add("City")
oColumn := oGrid:Columns():Add("Sort")
oColumn:ComputedField := "%1 + %2"
oColumn:Visible := .F.
oItems := oGrid:Items()
h := oItems:AddItem("+33")
oItems:SetProperty("CellValue",h,1,"Corsica")
oItems:SetProperty("CellValue",h,2,"Bastia ")
h := oItems:AddItem("+33")
oItems:SetProperty("CellValue",h,1,"Occitanie")
oItems:SetProperty("CellValue",h,2,"Toulouse ")
h := oItems:AddItem("+33")
oItems:SetProperty("CellValue",h,1,"Corsica")
oItems:SetProperty("CellValue",h,2,"Ajaccio")
h := oItems:AddItem("+33")
oItems:SetProperty("CellValue",h,1,"Occitanie")
oItems:SetProperty("CellValue",h,2,"Carcassonne ")
oGrid:Layout := "multiplesort=" + CHR(34) + "C0:2" + CHR(34) + ";singlesort=" + CHR(34) + "C3:1" + CHR(34) + ";"
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1250
|
How can I vertically scroll the control
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:ColumnAutoResize := .F.
oGrid:DataSource := CreateObject("DAO.DBEngine.120"):OpenDatabase("C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb"):OpenRecordset("Orders"):OpenDatabase("C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb"):OpenRecordset("Orders")
oGrid:Layout := "Collapse=" + CHR(34) + "" + CHR(34) + ";VScroll=10"
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1249
|
Export the items as a two-dimensional array

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:PutItems(oGrid:Export("array","all"))
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1248
|
Export only expanded items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","only(expanded)"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1247
|
Export only selectable, sortable leaf items that are neither locked nor dividers

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","only(leaf,sortable,selectable,!divider,!locked)"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1246
|
Export only non-divider items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","only(!divider)"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1245
|
Export only selectable items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","only(selectable)"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1244
|
Export only sortable, but not locked items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","only(sortable,!locked)"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1243
|
Export only checked items on specified column

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","only(checked[0])"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1242
|
Export only filtered, not locked or divider items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","only(visible,!locked,!divider)"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1241
|
Export only selected items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","only(selected)"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1240
|
Export only locked items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","only(locked)"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1239
|
Export the leaf items of the control, excluding parent or grouped items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","leaf"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1238
|
Export all checked and visible items (the first column in the columns list specifies the index of the column used to query the checkbox state)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","chk"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1237
|
Export the selected-items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","sel"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1236
|
Export the visible items, excluding child items of collapsed elements, non-visible items (such as those with a height of 0), and items that do not match the current filter

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","vis"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1235
|
Export all items, including the hidden or collapsed items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:ScrollBySingleLine := .T.
oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/
oColumns := oGrid:Columns()
oColumn := oColumns:Add("Desc")
oColumn:Width := 32
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn1 := oColumns:Add("Amount")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1:FormatColumn := "currency(value)"
oItems := oGrid:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("CellValue",h,0,"All")
oItems:SetProperty("CellValue",h,1,"sum(all,rec,%1)")
oItems:SetProperty("CellValueFormat",h,1,4/*exTotalField*/)
r := oItems:AddItem("Root 1")
g1 := oItems:InsertItem(r,,"Group A")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 1"),1,1)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 2"),1,2)
oItems:SetProperty("CellState",oItems:ItemByIndex(3),0,1)
g2 := oItems:InsertItem(r,,"Group B")
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 3"),1,3)
oItems:SetProperty("CellValue",oItems:InsertItem(g2,,"Item 4"),1,4)
oItems:SetProperty("ExpandItem",g1,.T.)
oItems:SetProperty("ExpandItem",r,.T.)
h := oItems:AddItem("divider")
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("SelectableItem",h,.F.)
oItems:SetProperty("SortableItem",h,.F.)
oItems:SetProperty("ItemHeight",h,1)
r := oItems:AddItem("Root 2")
g1 := oItems:InsertItem(r,,"Group C")
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 5"),1,5)
oItems:SetProperty("CellValue",oItems:InsertItem(g1,,"Item 6"),1,6)
oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
oGrid:EndUpdate()
DevOut( Transform(oGrid:Export("","all"),"") )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1234
|
Bolds only the expanded items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oGrid:ConditionalFormats():Add("%CX0"):Bold := .T.
oGrid:Columns():Add("Description")
oItems := oGrid:Items()
h := oItems:AddItem("Root 1")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(oItems:InsertItem(h,,"Child 2"),,"Sub-Child 2")
oItems:SetProperty("CellState",oItems:InsertItem(h,,"Child 3"),0,1)
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Root 2")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"Child 3")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1233
|
Displays the root item's index and value/caption using expressions

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1,oColumn2,oColumn3
LOCAL oConditionalFormat
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oGrid:AutoDrag := 3/*exAutoDragPositionAny*/
oGrid:AllowCopyPaste := 7/*exAllowPaste+exAllowCut+exAllowCopy*/
oGrid:SingleSel := .F.
oGrid:DrawGridLines := -2/*exRowLines*/
oGrid:GridLineStyle := 48/*exGridLinesSolid*/
oGrid:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 208,208,208 } ) , .F. ))
oGrid:ConditionalFormats():Add("%CC0 and %CX0"):Bold := .T.
oConditionalFormat := oGrid:ConditionalFormats():Add("1")
oConditionalFormat:Bold := .T.
oConditionalFormat:ApplyTo := 2/*0x2+*/
oColumn := oGrid:Columns():Add("Description")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oColumn1 := oGrid:Columns():Add("Index")
oColumn1:FormatColumn := "1 index ``"
oColumn1:Position := 0
oColumn1:Width := 16
oColumn2 := oGrid:Columns():Add("Root-Index")
oColumn2:FormatColumn := "root(1 index ``)"
oColumn2:Position := 1
oColumn2:Width := 32
oColumn2:SetProperty("Def",4/*exCellBackColor*/,15790320)
oColumn3 := oGrid:Columns():Add("Root-Value")
oColumn3:FormatColumn := "root(%0)"
oColumn3:Position := 2
oColumn3:Width := 32
oColumn3:SetProperty("Def",4/*exCellBackColor*/,15790320)
oItems := oGrid:Items()
h := oItems:AddItem("Root 1")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(oItems:InsertItem(h,,"Child 2"),,"Sub-Child 2")
oItems:SetProperty("CellState",oItems:InsertItem(h,,"Child 3"),0,1)
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Root 2")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"Child 3")
oItems:SetProperty("ExpandItem",h,.T.)
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1232
|
Displays the parent item's index and caption/value using expressions

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1,oColumn2,oColumn3
LOCAL oConditionalFormat
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oGrid:AutoDrag := 3/*exAutoDragPositionAny*/
oGrid:AllowCopyPaste := 7/*exAllowPaste+exAllowCut+exAllowCopy*/
oGrid:SingleSel := .F.
oGrid:DrawGridLines := -2/*exRowLines*/
oGrid:GridLineStyle := 48/*exGridLinesSolid*/
oGrid:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 208,208,208 } ) , .F. ))
oGrid:ConditionalFormats():Add("%CC0 and %CX0"):Bold := .T.
oConditionalFormat := oGrid:ConditionalFormats():Add("1")
oConditionalFormat:Bold := .T.
oConditionalFormat:ApplyTo := 2/*0x2+*/
oColumn := oGrid:Columns():Add("Description")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oColumn1 := oGrid:Columns():Add("Index")
oColumn1:FormatColumn := "1 index `I`"
oColumn1:Position := 0
oColumn1:Width := 16
oColumn2 := oGrid:Columns():Add("Parent-Index")
oColumn2:FormatColumn := "parent(1 index `I`)"
oColumn2:Position := 1
oColumn2:Width := 32
oColumn2:SetProperty("Def",4/*exCellBackColor*/,15790320)
oColumn3 := oGrid:Columns():Add("Parent-Value")
oColumn3:FormatColumn := "parent(%0)"
oColumn3:Position := 2
oColumn3:Width := 32
oColumn3:SetProperty("Def",4/*exCellBackColor*/,15790320)
oItems := oGrid:Items()
h := oItems:AddItem("Root 1")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(oItems:InsertItem(h,,"Child 2"),,"Sub-Child 2")
oItems:SetProperty("CellState",oItems:InsertItem(h,,"Child 3"),0,1)
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Root 2")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"Child 3")
oItems:SetProperty("ExpandItem",h,.T.)
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1231
|
Copying and Pasting the Selection Programmatically
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:Columns():Add("Tasks")
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oGrid:SingleSel := .F.
oItems := oGrid:Items()
oItems:AddItem("Tasks")
oItems:SetProperty("SelectItem",oItems:AddItem("Task 1"),.T.)
oItems:SetProperty("SelectItem",oItems:AddItem("Task 2"),.T.)
oGrid:IndentSelection(.F.)
oGrid:CopySelection()
oGrid:Items():UnselectAll()
oGrid:Paste()
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1230
|
Enable Copy, Cut and Paste Clipboard operations
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:Columns():Add("Tasks")
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oGrid:AllowCopyPaste := 7/*exAllowPaste+exAllowCut+exAllowCopy*/
oGrid:SingleSel := .F.
oItems := oGrid:Items()
oItems:AddItem("Tasks")
oItems:SetProperty("SelectItem",oItems:AddItem("Task 1"),.T.)
oItems:SetProperty("SelectItem",oItems:AddItem("Task 2"),.T.)
oGrid:IndentSelection(.F.)
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1229
|
Adjusts the hierarchy of selected items by changing their parent

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:Columns():Add("Tasks")
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oGrid:SingleSel := .F.
oItems := oGrid:Items()
oItems:AddItem("Tasks")
oItems:SetProperty("SelectItem",oItems:AddItem("Task A"),.T.)
oItems:SetProperty("SelectItem",oItems:AddItem("Task B"),.T.)
oGrid:IndentSelection(.F.)
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1228
|
Specify the size of the Columns panel

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderHeight := 24
oGrid:HeaderAppearance := 4/*Etched*/
oColumns := oGrid:Columns()
oColumns:Add("City")
oColumns:Add("Start"):Visible := .F.
oColumns:Add("End"):Visible := .F.
oGrid:ColumnsFloatBarRect := ",,96"
oGrid:ColumnsFloatBarVisible := 34/*exColumnsFloatBarVisibleAsChild+exColumnsFloatBarVisibleIncludeCheckColumns*/
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1227
|
Show a vertical line between pivot and Columns panel (EBN color)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABRsIQAAYAQGKIYBkAKBQAGaAoDDUNQxQwAAxwfBMKgBBCLIxhEYobgmGIXRpFICQTIcBhaGIZRiAKCRTDmHwyRCNIwCLD8QxtDqBY4gOZZXhal4cJTgMaBYi+Pw3DZHcbvBRkewzHQAKgnSjoDhEMg1CTVVYTDKdOSzDyEX7sIAACpOIZQVJVEY1VT8cyxIyEZimSypWqiYJ0Ty6cQwTAIgI")
oGrid:SetProperty("Background",87/*exColumnsFloatBackColor*/,0x1000000)
oGrid:HeaderHeight := 24
oGrid:HeaderAppearance := 4/*Etched*/
oColumns := oGrid:Columns()
oColumns:Add("City")
oColumns:Add("Start"):Visible := .F.
oColumns:Add("End"):Visible := .F.
oGrid:ColumnsFloatBarVisible := 34/*exColumnsFloatBarVisibleAsChild+exColumnsFloatBarVisibleIncludeCheckColumns*/
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1226
|
Change the background of the Columns panel (EBN color)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABNoCg6AADACAxRDAMgBQKAAzQFAYahqGKGAAGOD4JhUAIIRZGMIjFDcEwxC6NIpAWLoJDCH4mSTHYxgJIMWwzDiBZgkCA4fiGEYnThCIxzTJ0aw1CKbYRAKCUKoUAJFsSnQAJIgOO4lULPMIhDDQKQTIKBahoehqIhaEQyDSJNb2DCIahhMSEbKtCooDhGFZUWzLVxTJJNawHJqJJDuOTpSjKH4+RjWFKUXR9b4BJSNAgqeCQTiSWZEVxRUS0XbGCyZLSQY7uAAMKgOVoDYzdGLwHTtOwrMa1QAsDSbKqWZ5uRpHcQ5aAGN5DPbMbqwOaqLznAaLQLtG4RTikVRPTDYaj437+OaHGyNbI6HTNPpTlWDJWjYXI8l8C4fg6GYAAEEISgGJJGHQOocgyIwYnqKhYAAIQTH2MYRjQJBRAmZptmEAYIjGU5dk8UgOFgBJUgCTQIBYBoBmCCAmAqApghgDJUDmYQFCCZoEk2OBUm+" +;
"BZPCgZgagaYZIHYHoHmGWBcm8NwiEiFJVgmYgji4Kg6GKSI2C6C5jAiRgygwIojiycINkyeJmAYPJjkiTg+g+ZAIkCdIQkyWQWDuDxkBkJhKguZAzlIRQzGQc5ODWFJlEkVhWhWZYJFYTYTmUE4yF6F5mAmBhihiZhJhYX4WmQaAUnWGpOlmNhuhuZwJkYcocmcSY4naHZlkmKhrDuJ5JnYfofmgCgGgKIJnlmXJ2h4TQKBosRokoNoOiOaQKDSd4kmiChMncPBpgoZoaiaaZKHaHonmmE5iiKJRpDicomimaoKiaKoqmqSoeiIPgogqPotiyaxKlYPA+GuCqbBMa5KnaPovmwCwGj6LgP24RIhiyCwmkqMpsksNpKD6LQLBqOIzi0SxWlaHZtAOahPssM5Wi+IYtlsXpijKbZ5lyTo5mAE4UlqOpjHOQpEjubyanKPJvEuNgVj2TY1CCao+k2G52AyP5wAwBp9DYZZ1CCaxsAABAEICA")
oGrid:SetProperty("Background",87/*exColumnsFloatBackColor*/,0x1000000)
oGrid:HeaderHeight := 24
oGrid:HeaderAppearance := 4/*Etched*/
oColumns := oGrid:Columns()
oColumns:Add("City")
oColumns:Add("Start"):Visible := .F.
oColumns:Add("End"):Visible := .F.
oGrid:ColumnsFloatBarVisible := 34/*exColumnsFloatBarVisibleAsChild+exColumnsFloatBarVisibleIncludeCheckColumns*/
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1225
|
Change the background of the Columns panel (solid color)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderHeight := 24
oGrid:HeaderAppearance := 4/*Etched*/
oColumns := oGrid:Columns()
oColumns:Add("City")
oColumns:Add("Start"):Visible := .F.
oColumns:Add("End"):Visible := .F.
oGrid:ColumnsFloatBarVisible := 34/*exColumnsFloatBarVisibleAsChild+exColumnsFloatBarVisibleIncludeCheckColumns*/
oGrid:SetProperty("Background",87/*exColumnsFloatBackColor*/,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1224
|
Change the visual appearance of the Columns panel

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABNoCg6AADACAxRDAMgBQKAAzQFAYahqGKGAAGOD4JhUAIIRZGMIjFDcEwxC6NIpAWLoJDCH4mSTHYxgJIMWwzDiBZgkCA4fiGEYnThCIxzTJ0aw1CKbYRAKCUKoUAJFsSnQAJIgOO4lULPMIhDDQKQTIKBahoehqIhaEQyDSJNb2DCIahhMSEbKtCooDhGFZUWzLVxTJJNawHJqJJDuOTpSjKH4+RjWFKUXR9b4BJSNAgqeCQTiSWZEVxRUS0XbGCyZLSQY7uAAMKgOVoDYzdGLwHTtOwrMa1QAsDSbKqWZ5uRpHcQ5aAGN5DPbMbqwOaqLznAaLQLtG4RTikVRPTDYaj437+OaHGyNbI6HTNPpTlWDJWjYXI8l8C4fg6GYAAEEISgGJJGHQOocgyIwYnqKhYAAIQTH2MYRjQJBRAmZptmEAYIjGU5dk8UgOFgBJUgCTQIBYBoBmCCAmAqApghgDJUDmYQFCCZoEk2OBUm+" +;
"BZPCgZgagaYZIHYHoHmGWBcm8NwiEiFJVgmYgji4Kg6GKSI2C6C5jAiRgygwIojiycINkyeJmAYPJjkiTg+g+ZAIkCdIQkyWQWDuDxkBkJhKguZAzlIRQzGQc5ODWFJlEkVhWhWZYJFYTYTmUE4yF6F5mAmBhihiZhJhYX4WmQaAUnWGpOlmNhuhuZwJkYcocmcSY4naHZlkmKhrDuJ5JnYfofmgCgGgKIJnlmXJ2h4TQKBosRokoNoOiOaQKDSd4kmiChMncPBpgoZoaiaaZKHaHonmmE5iiKJRpDicomimaoKiaKoqmqSoeiIPgogqPotiyaxKlYPA+GuCqbBMa5KnaPovmwCwGj6LgP24RIhiyCwmkqMpsksNpKD6LQLBqOIzi0SxWlaHZtAOahPssM5Wi+IYtlsXpijKbZ5lyTo5mAE4UlqOpjHOQpEjubyanKPJvEuNgVj2TY1CCao+k2G52AyP5wAwBp9DYZZ1CCaxsAABAEICA")
oGrid:SetProperty("Background",92/*exColumnsFloatAppearance*/,0x1000000)
oGrid:SetProperty("Background",93/*exColumnsFloatCaptionBackColor*/,AutomationTranslateColor( GraMakeRGBColor ( { 246,246,246 } ) , .F. ))
oGrid:SetProperty("BackColorHeader",0x1000000)
oGrid:HeaderHeight := 24
oGrid:HeaderAppearance := 4/*Etched*/
oColumns := oGrid:Columns()
oColumns:Add("City")
oColumns:Add("Start"):Visible := .F.
oColumns:Add("End"):Visible := .F.
oGrid:SetProperty("Description",26/*exColumnsFloatBar*/,"Show/Hide")
oGrid:ColumnsFloatBarVisible := 2/*exColumnsFloatBarVisibleIncludeCheckColumns*/
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1223
|
Defines the symbol used to indicate repeated captions, providing a clear visual cue for identical entries (ditto mark)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:DrawGridLines := -2/*exRowLines*/
oGrid:Columns():Add("Country"):ShowIdem := "<fgcolor gray>〃"
oItems := oGrid:Items()
oItems:AddItem("Spain")
oItems:AddItem("Spain")
oItems:AddItem("Spain")
oItems:AddItem("Spain")
oItems:AddItem("Germany")
oItems:AddItem("Germany")
oItems:AddItem("Germany")
oItems:AddItem("Germany")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1222
|
Defines the symbol used to indicate repeated captions, providing a clear visual cue for identical entries (space)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:DrawGridLines := -2/*exRowLines*/
oGrid:Columns():Add("Country"):ShowIdem := " "
oItems := oGrid:Items()
oItems:AddItem("Spain")
oItems:AddItem("Spain")
oItems:AddItem("Spain")
oItems:AddItem("Spain")
oItems:AddItem("Germany")
oItems:AddItem("Germany")
oItems:AddItem("Germany")
oItems:AddItem("Germany")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1221
|
Displays a glitch funnel for drop-down filter buttons (empty or active)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oAppearance
LOCAL oColumn
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oAppearance := oGrid:VisualAppearance()
oAppearance:RenderType := -1
oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABa8IQAAYAQGKIYBkAKBQAGaAoDDUNQxQwAAxwfBMKgBBCLIxhEYobgmGIXRpFMbxCKQahLEiTIhGUYJHgmK4tRiAUgxVDkBxrECZYqjcBZOiwLQ2TxDM7DNKUCBnIoABhGOaYDh+IQNQjUFKwTRFGRxK4EIRKAyTDLQdRyGSMMbjdQpBCbMiMRqhESKRq2UwYRYCFS1NalaztO6BUAvK67YrWez/YBfF+SfwGeqDYReWAPfgWERnQrGMLxbD8KwZAKTRjkGJ4XhuB41TbQMqufL9ByXHKSSDpGjaXjeO5VVjYNAvS69UzXNq3bhtQAOXCMEwCgI=")
oAppearance:Add(2,"CP:1 -2 0 0 0")
oGrid:DrawGridLines := -1/*exAllLines*/
oGrid:GridLineStyle := 512/*exGridLinesGeometric*/
oGrid:ShowFocusRect := .F.
oGrid:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x2000000)
oGrid:SetProperty("Background",41/*exHeaderFilterBarActive*/,0x2000001)
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:SetProperty("BackColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oGrid:HeaderHeight := 24
oGrid:HeaderVisible := .T.
oColumn := oGrid:Columns():Add("1st col")
oColumn:DisplayFilterButton := .T.
oColumn:DisplayFilterPattern := .F.
oColumn:Filter := "Item B"
oColumn:FilterType := 240/*exFilter*/
oGrid:Columns():Add("2nd col")
oItems := oGrid:Items()
oItems:AddItem("Item A")
oItems:AddItem("Item B")
oItems:AddItem("Item C")
oGrid:ApplyFilter()
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1220
|
How can I store any extra data associated with a cell
PROCEDURE OnButtonClick(oGrid, Item, ColIndex, Key)
DevOut( Transform(oGrid:Items:CellData(Item,ColIndex),"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oEditor
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:ButtonClick := {|Item, ColIndex, Key| OnButtonClick(oGrid, Item, ColIndex, Key)} /*Occurs when user clicks on the cell's button.*/
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oEditor := oGrid:Columns():Add("Def"):Editor()
oEditor:EditType := 12/*ButtonType*/
oEditor:Locked := .T.
oItems := oGrid:Items()
oItems:SetProperty("CellData",oItems:AddItem("Cell 1"),0,"your extra data for cell 1")
oItems:SetProperty("CellData",oItems:AddItem("Cell 2"),0,"your extra data for cell 2")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1219
|
How can I replace or add an icon at runtime

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:ReplaceIcon("gAAAABgYACEHgUJFEEAAWhUJCEJEEJggEhMCYEXjUbjkJQECj8gj8hAEjkshYEpk8kf8ClsulsvAExmcvf83js5nU7nkCeEcn8boMaocXosCB9Hn09pkzcEuoL/fE+OkYB0gB9YhIHrddgVcr9aktZADAD8+P8CgIA==")
oGrid:ReplaceIcon("C:\images\favicon.ico",0)
oGrid:Columns():Add("Items"):SetProperty("Def",17/*exCellValueFormat*/,1)
oGrid:Items():AddItem("Item <img>1</img>")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1218
|
How can I save the changes, such as column's width, order

PROCEDURE OnClick(oGrid)
oGrid:Layout := "Select=" + CHR(34) + "0" + CHR(34) + ";SingleSort=" + CHR(34) + "C0:2" + CHR(34) + ";Columns=1"
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:Click := {|| OnClick(oGrid)} /*Occurs when the user presses and then releases the left mouse button over the grid control.*/
oGrid:BeginUpdate()
oGrid:Columns():Add("Column")
oItems := oGrid:Items()
oItems:AddItem("Item 1")
oItems:AddItem("Item 2")
oItems:AddItem("Item 3")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1217
|
How can I add totals to groups without having to go through the AddGroupItem grid function

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oConditionalFormat,oConditionalFormat1,oConditionalFormat2
LOCAL oConditionalFormats
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:FreezeEvents(.T.)
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oConditionalFormats := oGrid:ConditionalFormats()
oConditionalFormat := oConditionalFormats:Add("%CT1")
oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. ))
oConditionalFormat:ApplyTo := 1/*0x1+*/
oConditionalFormat1 := oConditionalFormats:Add("%CT2")
oConditionalFormat1:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. ))
oConditionalFormat1:ApplyTo := 2/*0x2+*/
oConditionalFormat2 := oConditionalFormats:Add("%CT3")
oConditionalFormat2:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. ))
oConditionalFormat2:ApplyTo := 3/*0x3+*/
oColumns := oGrid:Columns()
oColumns:Add("Description")
oColumn := oColumns:Add("Qty")
oColumn:Editor():EditType := 4/*SpinType*/
oColumn:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1 := oColumns:Add("Price")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"avg(current,rec,%2)")
oColumn1:Editor():EditType := 4/*SpinType*/
oColumn2 := oColumns:Add("Amount")
oColumn2:ComputedField := "%1 * %2"
oColumn2:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%3)")
oItems := oGrid:Items()
r := oItems:AddItem("Root")
g1 := oItems:InsertItem(r,,"Group 1")
h := oItems:InsertItem(g1,,"Item 1")
oItems:SetProperty("CellValue",h,1,1)
oItems:SetProperty("CellValue",h,2,10)
h := oItems:InsertItem(g1,,"Item 2")
oItems:SetProperty("CellValue",h,1,2)
oItems:SetProperty("CellValue",h,2,11)
g2 := oItems:InsertItem(r,,"Group 2")
h := oItems:InsertItem(g2,,"Item 1")
oItems:SetProperty("CellValue",h,1,3)
oItems:SetProperty("CellValue",h,2,12)
h := oItems:InsertItem(g2,,"Item 2")
oItems:SetProperty("CellValue",h,1,4)
oItems:SetProperty("CellValue",h,2,13)
oItems:SetProperty("ExpandItem",0,.T.)
oGrid:EndUpdate()
oGrid:FreezeEvents(.F.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1216
|
How can I configure the filters in the text columns to search by content

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
oGrid:HeaderAppearance := 0/*None2*/
oGrid:FilterBarPromptType := 1/*exFilterPromptContainsAll*/
oGrid:Columns():Add("Names")
oItems := oGrid:Items()
oItems:AddItem("Mantel")
oItems:AddItem("Mechanik")
oItems:AddItem("Motor")
oItems:AddItem("Murks")
oItems:AddItem("Märchen")
oItems:AddItem("Möhren")
oItems:AddItem("Mühle")
oItems:AddItem("Sérigraphie")
oGrid:FilterBarPromptPattern := "a"
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1215
|
How can I display the control's captions in Spanish

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
oGrid:HeaderAppearance := 0/*None2*/
oGrid:SetProperty("Description",0/*exFilterBarAll*/,"(todo) ")
oGrid:SetProperty("Description",3/*exFilterBarFilterForCaption*/,"filtrar por...")
oGrid:FilterBarPrompt := "<i><fgcolor=808080>iniciar filtro...</fgcolor></i>"
oColumn := oGrid:Columns():Add("Names")
oColumn:DisplayFilterButton := .T.
oColumn:FilterType := 3/*exPattern*/
oItems := oGrid:Items()
oItems:AddItem("Mantel")
oItems:AddItem("Mechanik")
oItems:AddItem("Motor")
oItems:AddItem("Murks")
oItems:AddItem("Märchen")
oItems:AddItem("Möhren")
oItems:AddItem("Mühle")
oItems:AddItem("Sérigraphie")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1214
|
How can I zoom in the control

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn
LOCAL oItems
LOCAL s1,s2
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
s1 := 16
s2 := oGrid:FormatABC("2 * value",s1)
oGrid:ImageSize := s2
oGrid:DefaultItemHeight := s2
oGrid:HeaderHeight := s2
oGrid:SortBarHeight := s2
oGrid:Indent := s2
oGrid:Font():Size := s1
oGrid:FilterBarFont():Size := s1
oGrid:ToolTipFont():Size := s1
oGrid:FilterBarPromptVisible := 1/*exFilterBarPromptVisible*/
oGrid:HeaderAppearance := 0/*None2*/
oColumn := oGrid:Columns():Add("Names")
oColumn:DisplayFilterButton := .T.
oColumn:FilterType := 3/*exPattern*/
oItems := oGrid:Items()
oItems:AddItem("Mantel")
oItems:AddItem("Mechanik")
oItems:AddItem("Motor")
oItems:AddItem("Murks")
oItems:AddItem("Märchen")
oItems:AddItem("Möhren")
oItems:AddItem("Mühle")
oItems:AddItem("Sérigraphie")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1213
|
Can I set a filter that automatically adds a * before and after the word, so the user can just search for 'cat' and it becomes '*cat*' automatically

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oColumn := oGrid:Columns():Add("Items")
oColumn:DisplayFilterButton := .T.
oColumn:DisplayFilterPattern := .T.
oColumn:SetProperty("Def",21/*exFilterPatternTemplate*/,"*<%filter%>*")
oColumn:FilterType := 3/*exPattern*/
oColumn:Filter := "1"
oItems := oGrid:Items()
h := oItems:AddItem("Root 1")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Root 2")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oGrid:ApplyFilter()
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1212
|
The fine dotted lines in the control appear much thicker than the standard ones we've been using. How can we fix this

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:DrawGridLines := -1/*exAllLines*/
oGrid:GridLineStyle := 512/*exGridLinesGeometric*/
oGrid:ColumnAutoResize := .F.
oGrid:Columns():Add("Column 1")
oGrid:Columns():Add("Column 2")
oGrid:Columns():Add("Column 3")
oGrid:Columns():Add("Column 4")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1211
|
Load data as a tree using a parent-id relationship

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL rs
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:ColumnAutoResize := .F.
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:DrawGridLines := 2/*exVLines*/
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
rs := CreateObject("ADODB.Recordset")
rs:Open("Select * FROM Employees WHERE 1=0","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.mdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
oGrid:DataSource := rs
oGrid:Columns:Item(0):Width := 128
rs := CreateObject("ADODB.Recordset")
rs:Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.mdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
oGrid:PutItems(rs:GetRows(),";0;17")
oGrid:Items():SetProperty("ExpandItem",0,.T.)
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1210
|
Is there a way to change the contents of the drop down editor based on a value in another column

PROCEDURE OnAddItem(oGrid, Item)
oGrid:Items():SetProperty("CellEditorVisible",Item,0,1/*exEditorVisible*/)
oGrid:Items():SetProperty("CellEditorVisible",Item,1,1/*exEditorVisible*/)
RETURN
PROCEDURE OnEditOpen(oGrid)
LOCAL oEditor
LOCAL oItems
LOCAL c,v
oItems := oGrid:Items()
v := oItems:CellValue(oItems:FocusItem(),0)
c := oItems:CellCaption(oItems:FocusItem(),0)
oEditor := oGrid:Columns:Item(1):Editor()
oEditor:ClearItems()
oEditor:AddItem(v,Transform(c,""))
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn
LOCAL oEditor
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:AddItem := {|Item| OnAddItem(oGrid, Item)} /*Occurs after a new Item has been inserted to Items collection.*/
oGrid:EditOpen := {|| OnEditOpen(oGrid)} /*Occurs when the edit operation starts.*/
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:GridLineStyle := 512/*exGridLinesGeometric*/
oColumn := oGrid:Columns():Add("DropDownList")
oEditor := oColumn:Editor()
oEditor:EditType := 3/*DropDownListType*/
oEditor:AddItem(1,"First")
oEditor:AddItem(2,"Second")
oEditor:AddItem(3,"Third")
oGrid:DrawGridLines := -1/*exAllLines*/
oGrid:Columns():Add("DropDownList-Related"):Editor():EditType := 3/*DropDownListType*/
oItems := oGrid:Items()
oItems:SetProperty("CellValue",oItems:AddItem(1),1,-1)
oItems:SetProperty("CellValue",oItems:AddItem(2),1,-1)
oItems:SetProperty("CellValue",oItems:AddItem(3),1,-1)
oItems:SetProperty("LockedItemCount",2/*exBottom*/,1)
h := oItems:LockedItem(2/*exBottom*/,0)
oItems:SetProperty("ItemDivider",h,0)
oItems:SetProperty("ItemDividerLineAlignment",h,2/*DividerTop*/)
oItems:SetProperty("CellEditorVisible",h,0,0/*exEditorHidden*/)
oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/)
oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/)
oItems:SetProperty("CellValue",h,0,"The drop down editor in the second column is filled during the <b>EditOpen event</b>, and the values are based on the selection on the first column.")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1209
|
Highlight the editable fields

PROCEDURE OnChange(oGrid, Item, ColIndex, NewValue)
oGrid:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oConditionalFormat,oConditionalFormat1,oConditionalFormat2
LOCAL oConditionalFormats
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:Change := {|Item, ColIndex, NewValue| OnChange(oGrid, Item, ColIndex, NewValue)} /*Occurs when the user changes the cell's content.*/
oGrid:FreezeEvents(.T.)
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oConditionalFormats := oGrid:ConditionalFormats()
oConditionalFormat := oConditionalFormats:Add("%CE1")
oConditionalFormat:Bold := .T.
oConditionalFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 245,245,245 } ) , .F. ))
oConditionalFormat:ApplyTo := 1/*0x1+*/
oConditionalFormat1 := oConditionalFormats:Add("%CE2")
oConditionalFormat1:Bold := .T.
oConditionalFormat1:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 245,245,245 } ) , .F. ))
oConditionalFormat1:ApplyTo := 2/*0x2+*/
oConditionalFormat2 := oConditionalFormats:Add("%CE3")
oConditionalFormat2:Bold := .T.
oConditionalFormat2:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 245,245,245 } ) , .F. ))
oConditionalFormat2:ApplyTo := 3/*0x3+*/
oColumns := oGrid:Columns()
oColumns:Add("Description")
oColumn := oColumns:Add("Qty")
oColumn:Editor():EditType := 4/*SpinType*/
oColumn:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1 := oColumns:Add("Price")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"avg(current,rec,%2)")
oColumn1:Editor():EditType := 4/*SpinType*/
oColumn2 := oColumns:Add("Amount")
oColumn2:ComputedField := "%1 * %2"
oColumn2:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%3)")
oItems := oGrid:Items()
r := oItems:AddItem("Root")
g1 := oItems:InsertItem(r,,"Group 1")
h := oItems:InsertItem(g1,,"Item 1")
oItems:SetProperty("CellValue",h,1,1)
oItems:SetProperty("CellValue",h,2,10)
h := oItems:InsertItem(g1,,"Item 2")
oItems:SetProperty("CellValue",h,1,2)
oItems:SetProperty("CellValue",h,2,11)
g2 := oItems:InsertItem(r,,"Group 2")
h := oItems:InsertItem(g2,,"Item 1")
oItems:SetProperty("CellValue",h,1,3)
oItems:SetProperty("CellValue",h,2,12)
h := oItems:InsertItem(g2,,"Item 2")
oItems:SetProperty("CellValue",h,1,4)
oItems:SetProperty("CellValue",h,2,13)
oItems:SetProperty("ExpandItem",0,.T.)
oGrid:EndUpdate()
oGrid:FreezeEvents(.F.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1208
|
Highlight the total fields

PROCEDURE OnChange(oGrid, Item, ColIndex, NewValue)
oGrid:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oConditionalFormat,oConditionalFormat1,oConditionalFormat2
LOCAL oConditionalFormats
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:Change := {|Item, ColIndex, NewValue| OnChange(oGrid, Item, ColIndex, NewValue)} /*Occurs when the user changes the cell's content.*/
oGrid:FreezeEvents(.T.)
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oConditionalFormats := oGrid:ConditionalFormats()
oConditionalFormat := oConditionalFormats:Add("%CT1")
oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. ))
oConditionalFormat:ApplyTo := 1/*0x1+*/
oConditionalFormat1 := oConditionalFormats:Add("%CT2")
oConditionalFormat1:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. ))
oConditionalFormat1:ApplyTo := 2/*0x2+*/
oConditionalFormat2 := oConditionalFormats:Add("%CT3")
oConditionalFormat2:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. ))
oConditionalFormat2:ApplyTo := 3/*0x3+*/
oColumns := oGrid:Columns()
oColumns:Add("Description")
oColumn := oColumns:Add("Qty")
oColumn:Editor():EditType := 4/*SpinType*/
oColumn:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1 := oColumns:Add("Price")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"avg(current,rec,%2)")
oColumn1:Editor():EditType := 4/*SpinType*/
oColumn2 := oColumns:Add("Amount")
oColumn2:ComputedField := "%1 * %2"
oColumn2:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%3)")
oItems := oGrid:Items()
r := oItems:AddItem("Root")
g1 := oItems:InsertItem(r,,"Group 1")
h := oItems:InsertItem(g1,,"Item 1")
oItems:SetProperty("CellValue",h,1,1)
oItems:SetProperty("CellValue",h,2,10)
h := oItems:InsertItem(g1,,"Item 2")
oItems:SetProperty("CellValue",h,1,2)
oItems:SetProperty("CellValue",h,2,11)
g2 := oItems:InsertItem(r,,"Group 2")
h := oItems:InsertItem(g2,,"Item 1")
oItems:SetProperty("CellValue",h,1,3)
oItems:SetProperty("CellValue",h,2,12)
h := oItems:InsertItem(g2,,"Item 2")
oItems:SetProperty("CellValue",h,1,4)
oItems:SetProperty("CellValue",h,2,13)
oItems:SetProperty("ExpandItem",0,.T.)
oGrid:EndUpdate()
oGrid:FreezeEvents(.F.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1207
|
Highlight the leaf items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumns
LOCAL oItems
LOCAL h,hR
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:ConditionalFormats():Add("%CC0=0"):SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. ))
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oColumns := oGrid:Columns()
oColumns:Add("Item"):Width := 16
oColumns:Add("Desc")
oItems := oGrid:Items()
hR := oItems:AddItem("Root")
oItems:SetProperty("CellValue",hR,1,"The root directory /")
oItems:SetProperty("ExpandItem",hR,.T.)
h := oItems:InsertItem(hR,,"Home")
oItems:SetProperty("CellValue",h,1,"The home directory with user directories Alice and Bob")
oItems:InsertItem(h,,"Alice")
oItems:InsertItem(h,,"Bob")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:InsertItem(hR,,"Etc")
oItems:SetProperty("CellValue",h,1,"The etc directory with one configuration file")
h := oItems:InsertItem(h,,"nginx.conf")
oItems:SetProperty("CellValue",oItems:InsertItem(hR,,"Var"),1,"The var directory")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1206
|
Highlight the parent items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumns
LOCAL oItems
LOCAL h,hR
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:ConditionalFormats():Add("%CC0"):SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oColumns := oGrid:Columns()
oColumns:Add("Item"):Width := 16
oColumns:Add("Desc")
oItems := oGrid:Items()
hR := oItems:AddItem("Root")
oItems:SetProperty("CellValue",hR,1,"The root directory /")
oItems:SetProperty("ExpandItem",hR,.T.)
h := oItems:InsertItem(hR,,"Home")
oItems:SetProperty("CellValue",h,1,"The home directory with user directories Alice and Bob")
oItems:InsertItem(h,,"Alice")
oItems:InsertItem(h,,"Bob")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:InsertItem(hR,,"Etc")
oItems:SetProperty("CellValue",h,1,"The etc directory with one configuration file")
h := oItems:InsertItem(h,,"nginx.conf")
oItems:SetProperty("CellValue",oItems:InsertItem(hR,,"Var"),1,"The var directory")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1205
|
Highlight the item being expanded or collapsed

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumns
LOCAL oItems
LOCAL h,hR
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:ConditionalFormats():Add("%CX0"):Bold := .T.
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oColumns := oGrid:Columns()
oColumns:Add("Item"):Width := 16
oColumns:Add("Desc")
oItems := oGrid:Items()
hR := oItems:AddItem("Root")
oItems:SetProperty("CellValue",hR,1,"The root directory /")
oItems:SetProperty("ExpandItem",hR,.T.)
h := oItems:InsertItem(hR,,"Home")
oItems:SetProperty("CellValue",h,1,"The home directory with user directories Alice and Bob")
oItems:InsertItem(h,,"Alice")
oItems:InsertItem(h,,"Bob")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:InsertItem(hR,,"Etc")
oItems:SetProperty("CellValue",h,1,"The etc directory with one configuration file")
h := oItems:InsertItem(h,,"nginx.conf")
oItems:SetProperty("CellValue",oItems:InsertItem(hR,,"Var"),1,"The var directory")
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1204
|
I am using exTotalColumn. Is there an option to exclude specific cells to display the total

PROCEDURE OnChange(oGrid, Item, ColIndex, NewValue)
oGrid:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:Change := {|Item, ColIndex, NewValue| OnChange(oGrid, Item, ColIndex, NewValue)} /*Occurs when the user changes the cell's content.*/
oGrid:FreezeEvents(.T.)
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oColumns := oGrid:Columns()
oColumns:Add("Description")
oColumn := oColumns:Add("Qty")
oColumn:Editor():EditType := 4/*SpinType*/
oColumn:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1 := oColumns:Add("Price")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"avg(current,rec,%2)")
oColumn1:Editor():EditType := 4/*SpinType*/
oColumn2 := oColumns:Add("Amount")
oColumn2:ComputedField := "%1 * %2"
oColumn2:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%3)")
oItems := oGrid:Items()
r := oItems:AddItem("Root")
g1 := oItems:InsertItem(r,,"Group 1")
oItems:SetProperty("FormatCell",g1,2,"`<average missing>`")
oItems:SetProperty("CellEditorVisible",g1,2,0/*exEditorHidden*/)
oItems:SetProperty("CellBold",g1,2,.T.)
oItems:SetProperty("CellForeColor",g1,2,AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
h := oItems:InsertItem(g1,,"Item 1")
oItems:SetProperty("CellValue",h,1,1)
oItems:SetProperty("CellValue",h,2,10)
h := oItems:InsertItem(g1,,"Item 2")
oItems:SetProperty("CellValue",h,1,2)
oItems:SetProperty("CellValue",h,2,11)
g2 := oItems:InsertItem(r,,"Group 2")
h := oItems:InsertItem(g2,,"Item 1")
oItems:SetProperty("CellValue",h,1,3)
oItems:SetProperty("CellValue",h,2,12)
h := oItems:InsertItem(g2,,"Item 2")
oItems:SetProperty("CellValue",h,1,4)
oItems:SetProperty("CellValue",h,2,13)
oItems:SetProperty("ExpandItem",0,.T.)
oGrid:EndUpdate()
oGrid:FreezeEvents(.F.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1203
|
How can I add a total column

PROCEDURE OnChange(oGrid, Item, ColIndex, NewValue)
oGrid:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oItems
LOCAL g1,g2,h,r
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:Change := {|Item, ColIndex, NewValue| OnChange(oGrid, Item, ColIndex, NewValue)} /*Occurs when the user changes the cell's content.*/
oGrid:FreezeEvents(.T.)
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:HeaderHeight := 24
oGrid:LinesAtRoot := -1/*exLinesAtRoot*/
oColumns := oGrid:Columns()
oColumns:Add("Description")
oColumn := oColumns:Add("Qty")
oColumn:Editor():EditType := 4/*SpinType*/
oColumn:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%1)")
oColumn1 := oColumns:Add("Price")
oColumn1:SetProperty("Def",20/*exTotalColumn*/,"avg(current,rec,%2)")
oColumn1:Editor():EditType := 4/*SpinType*/
oColumn2 := oColumns:Add("Amount")
oColumn2:ComputedField := "%1 * %2"
oColumn2:SetProperty("Def",20/*exTotalColumn*/,"sum(current,rec,%3)")
oItems := oGrid:Items()
r := oItems:AddItem("Root")
g1 := oItems:InsertItem(r,,"Group 1")
h := oItems:InsertItem(g1,,"Item 1")
oItems:SetProperty("CellValue",h,1,1)
oItems:SetProperty("CellValue",h,2,10)
h := oItems:InsertItem(g1,,"Item 2")
oItems:SetProperty("CellValue",h,1,2)
oItems:SetProperty("CellValue",h,2,11)
g2 := oItems:InsertItem(r,,"Group 2")
h := oItems:InsertItem(g2,,"Item 1")
oItems:SetProperty("CellValue",h,1,3)
oItems:SetProperty("CellValue",h,2,12)
h := oItems:InsertItem(g2,,"Item 2")
oItems:SetProperty("CellValue",h,1,4)
oItems:SetProperty("CellValue",h,2,13)
oItems:SetProperty("ExpandItem",0,.T.)
oGrid:EndUpdate()
oGrid:FreezeEvents(.F.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1202
|
Is it possible to disable sizing(size) the column
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
LOCAL oColumn
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:DrawGridLines := 2/*exVLines*/
oColumn := oGrid:Columns():Add("32px")
oColumn:Width := 32
oColumn:AllowSizing := .F.
oGrid:Columns():Add("Rest")
oGrid:ColumnAutoResize := .T.
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1201
|
How can I add two columns of 25% and the third of 50%

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oGrid
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oGrid := XbpActiveXControl():new( oForm:drawingArea )
oGrid:CLSID := "Exontrol.Grid.1" /*{101EE60F-7B07-48B0-A13A-F32BAE7DA165}*/
oGrid:create(,, {10,60},{610,370} )
oGrid:BeginUpdate()
oGrid:HeaderAppearance := 4/*Etched*/
oGrid:DrawGridLines := 2/*exVLines*/
oGrid:Columns():Add("25%"):Width := 25
oGrid:Columns():Add("25%"):Width := 25
oGrid:Columns():Add("50%"):Width := 50
oGrid:ColumnAutoResize := .T.
oGrid:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|