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
|
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
|
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
|
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 |
1200 |
I add two columns but I see a third column
|
1199 |
I lose the hierarchy, all items are on the same 1st level, while I use PutItems
#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:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:Columns():Add("C1") oGrid:Columns():Add("C2") oItems := oGrid:Items() oItems:SetProperty("CellValue",oItems:AddItem("Emily"),1,"William") oItems:SetProperty("CellValue",oItems:AddItem("Sophia"),1,"Alexander") oGrid:PutItems(oGrid:GetItems(""),oGrid:Items:ItemByIndex(0)) oGrid:PutItems(oGrid:GetItems(""),oGrid:Items:ItemByIndex(1)) oGrid:PutItems(oGrid:GetItems(""),oGrid:Items:ItemByIndex(6)) 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 |
1198 |
Column width set by code is ignored or it seems that does not work
|
1197 |
I want to display this computed value in a TextBox outside the grid and get it updated with any change of its value. How can this be done
PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue) LOCAL oItems oGrid:Refresh() oItems := oGrid:Items() DevOut( "Total: " ) DevOut( oItems:CellCaption(oItems:LockedItem(0/*exTop*/,0),0) ) 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,oItems1 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:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/ oGrid:BeginUpdate() oColumn := oGrid:Columns():Add("Numbers") oEditor := oColumn:Editor() oEditor:Numeric := -1/*exInteger*/ oEditor:EditType := 4/*SpinType*/ oColumn:SortType := 1/*SortNumeric*/ oItems := oGrid:Items() oItems:SetProperty("LockedItemCount",0/*exTop*/,1) h := oItems:LockedItem(0/*exTop*/,0) oItems:SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oItems:SetProperty("CellValue",h,0,"sum(all,dir,dbl(%0))") oItems:SetProperty("CellValueFormat",h,0,4/*exTotalField*/) oItems:SetProperty("CellHAlignment",h,0,2/*RightAlignment*/) oItems:SetProperty("FormatCell",h,0,"'Total: '+value") oItems1 := oGrid:Items() oItems1:AddItem(10) oItems1:AddItem(25) oItems1:AddItem(31) oItems1:AddItem(48) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1196 |
Disable temporarily the column's sort, resize and drag and drop
#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:SortBarVisible := .T. oGrid:SortBarCaption := "<fgcolor 808080><c>the header and the sort-bar are disabled (no drag and drop is allowed)" oGrid:AllowGroupBy := .T. oGrid:HeaderEnabled := .F. oGrid:HeaderAppearance := 4/*Etched*/ oGrid:Columns():Add("Index"):FormatColumn := "1 index ``" oGrid:Columns():Add("Pos"):FormatColumn := "1 apos ``" oGrid:Columns():Add("Edit"):Editor():EditType := 1/*EditType*/ oGrid:GridLineStyle := 512/*exGridLinesGeometric*/ oGrid:DrawGridLines := 2/*exVLines*/ oGrid:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor ( { 224,224,224 } ) , .F. )) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1195 |
I wonder if it’s possible to highlight/select a column like Excel
PROCEDURE OnColumnClick(oGrid,Column) /*Column.Selected = True*/ /*FocusColumnIndex = Column.Index*/ oGrid:Columns:Item(0):Selected := .F. oGrid:Columns:Item(1):Selected := .F. oGrid:Columns:Item(2):Selected := .F. oGrid:Items():SelectAll() 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:ColumnClick := {|Column| OnColumnClick(oGrid,Column)} /*Fired after the user clicks on column's header.*/ oGrid:BeginUpdate() oGrid:SetProperty("Background",32/*exCursorHoverColumn*/,-1) oGrid:HeaderAppearance := 4/*Etched*/ oGrid:MarkSearchColumn := .F. oGrid:SingleSel := .F. oGrid:FullRowSelect := 1/*exRectSel*/ oGrid:SortOnClick := 0/*exNoSort*/ oGrid:Columns():Add("Column1") oGrid:Columns():Add("Column2") oGrid:Columns():Add("Column3") oItems := oGrid:Items() oItems:DefaultItem := oItems:AddItem(0) oItems:SetProperty("CellValue",0,1,1) oItems:SetProperty("CellValue",0,2,2) oItems:DefaultItem := oItems:AddItem(3) oItems:SetProperty("CellValue",0,1,4) oItems:SetProperty("CellValue",0,2,5) oItems:DefaultItem := oItems:AddItem(6) oItems:SetProperty("CellValue",0,1,7) oItems:SetProperty("CellValue",0,2,8) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1194 |
Is it possible to change the color of the border
#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:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABc8IQAAYAQGKIcBiAKBQAGaAoDDMMwyQwAAxDMK8EwsACEIrjKCRShyCYZRhGcTALBIBQSHAZZKgOJIRDENg2SANACRfIUaw1DqBZwkGZoWhGKgAShIEDwSKkQBlECeJpnKaqIomJYnDLQUw0NL9HQ3JaaKqnWLBVCWEQyVzEIyjBT0EzHMqtKrjaA6NpaP4oT7LEIydKFCRJNi0bSnGqaOj6UJSURRVq3TTFcTyAC3ahuOo4cpXB4SWrOd41fYNOTQACzbCsSIcPxCe6GXjiNwjPKMWhnIq+M5wXIrJyKCYUaTcejzfgdU5XWqeMoyewMXxmZqbXw/fBYRrEL5vTqNXTzSA4BEB") oGrid:Appearance := 16842496/*0x100ff00+*/ oGrid:ColumnAutoResize := .T. oGrid:HeaderAppearance := 4/*Etched*/ oGrid:TreeColumnIndex := -1 oGrid:DrawGridLines := -1/*exAllLines*/ oGrid:GridLineStyle := 512/*exGridLinesGeometric*/ oGrid:Columns():Add("Default") oItems := oGrid:Items() oItems:AddItem("before item") oItems:AddItem("item") oItems:AddItem("after item") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1193 |
Expandable-caption
PROCEDURE OnAnchorClick(oGrid,AnchorID,Options) DevOut( Transform(AnchorID,"") ) RETURN #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:AnchorClick := {|AnchorID,Options| OnAnchorClick(oGrid,AnchorID,Options)} /*Occurs when an anchor element is clicked.*/ oGrid:BeginUpdate() oGrid:ColumnAutoResize := .T. oGrid:TreeColumnIndex := -1 oGrid:DrawGridLines := -1/*exAllLines*/ oGrid:GridLineStyle := 512/*exGridLinesGeometric*/ oGrid:SetProperty("BackColorAlternate",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oGrid:ShowFocusRect := .F. oGrid:Columns():Add("Default") oItems := oGrid:Items() oItems:AddItem("before item") h := oItems:AddItem("<solidline> <c><b>Bank Account</b></solidline><br>+ owner: String <r><a 1;e64=gA8ABzABvABsABpABkg8JABuABlAA+AAgAECMcTi4AMwAM4AjMGhEGOUVAA4AAwk8plcqihwAElg0wiUlOkOiUEgQvgcFhsKhkIhUQiUUnccj0gn0jmMagUlowAMNOpEfkMNkkmlEqrctjQmAAjAA5AA2sssHcbnkdq1Ln1QtVSjQAAEBA==>▲</a><br><solidline>+ balance: Currency = 0</solidline><br>+ deposit(amount: Currency)<r><a 2;e64=gA8ABjAA+AECMwAM8DABvABshoAOQAEAAHAAGEWjEajMGNoAMoAOgANERMgAOcHAAvAEJhcEh0Qh0Tg0CmkqMMFlUuhkxiMTisXjNCjk6EwAEYAHIAG1MjY7lUsnkwh8/nUClk5gwAAEBA==> " +; "650;</a><br>+ withdraw(amount: Currency)") oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/) oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/) oItems:AddItem("after item") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1192 |
Expandable-caption
#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:ColumnAutoResize := .T. oGrid:TreeColumnIndex := -1 oGrid:DrawGridLines := -1/*exAllLines*/ oGrid:GridLineStyle := 512/*exGridLinesGeometric*/ oGrid:SetProperty("BackColorAlternate",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oGrid:ShowFocusRect := .F. oGrid:Columns():Add("Default") oItems := oGrid:Items() oItems:AddItem("before item") h := oItems:AddItem("<solidline><b>Header</b></solidline><br>Line1<r><a ;exp=show lines>+</a><br>Line2<br>Line3") oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/) oItems:SetProperty("CellSingleLine",h,0,0/*exCaptionWordWrap*/) oItems:AddItem("after item") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1191 |
Force hover-all feature
#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:SetProperty("Background",500/*exScrollHoverAll*/,-1) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1190 |
Disable hover-all feature (Windows 11 or greater)
#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:SetProperty("Background",500/*exScrollHoverAll*/,AutomationTranslateColor( GraMakeRGBColor ( { 1,0,0 } ) , .F. )) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1189 |
Display a custom tooltip
PROCEDURE OnMouseMove(oGrid,Button,Shift,X,Y) oGrid:ShowToolTip("new content","",,"+8","+8") 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:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oGrid,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/ oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1188 |
Shows the tooltip of the object moved relative to its default position
PROCEDURE OnMouseMove(oGrid,Button,Shift,X,Y) oGrid:ShowToolTip("<null>","<null>",,"+8","+8") 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:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oGrid,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/ oGrid:ColumnAutoResize := .F. oGrid:Columns():Add("tootip"):ToolTip := "this is a tooltip assigned to a column" oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1187 |
Delete all records
PROCEDURE OnButtonClick(oGrid,Item,ColIndex,Key) LOCAL cmd cmd := CreateObject("ADODB.Command") cmd:ActiveConnection := oGrid:DataSource():ActiveConnection() cmd:CommandText := "Delete * from ORDERS" cmd:CommandType := 1/*adCmdText*/ cmd:Execute() oGrid:DataSource():Requery() RETURN PROCEDURE OnError(oGrid,Error,Description) DevOut( Transform(Description,"") ) RETURN #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 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:ButtonClick := {|Item,ColIndex,Key| OnButtonClick(oGrid,Item,ColIndex,Key)} /*Occurs when user clicks on the cell's button.*/ oGrid:Error := {|Error,Description| OnError(oGrid,Error,Description)} /*Fired when an internal error occurs.*/ oGrid:BeginUpdate() oGrid:HeaderAppearance := 4/*Etched*/ oGrid:ColumnAutoResize := .F. rs := CreateObject("ADODB.Recordset") rs:Open("Select * From Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",1/*adOpenKeyset*/,3/*adLockOptimistic*/) oGrid:DataSource := rs oGrid:ConditionalFormats():Add("%1=12345"):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oItems := oGrid:Items() oItems:SetProperty("LockedItemCount",0/*exTop*/,1) h := oItems:LockedItem(0/*exTop*/,0) oItems:SetProperty("ItemDivider",h,0) oItems:SetProperty("CellHasButton",h,0,.T.) oItems:SetProperty("CellValue",h,0,"Requery (delete all records, using ADODB.Command)") oItems:SetProperty("CellHAlignment",h,0,1/*CenterAlignment*/) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1186 |
How can I get a cell that shows the sum of a column of minutes in hours + minutes format
#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:BeginUpdate() oGrid:HeaderAppearance := 4/*Etched*/ oColumn := oGrid:Columns():Add("Minutes") oColumn:SortType := 1/*SortNumeric*/ oEditor := oColumn:Editor() oEditor:EditType := 1/*EditType*/ oEditor:Numeric := -1/*exInteger*/ oItems := oGrid:Items() oItems:AddItem(10) oItems:AddItem(20) oItems:AddItem(30) oItems:AddItem(40) oItems:AddItem(50) h := oItems:AddItem("sum(all,dir,dbl(%0))") oItems:SetProperty("SelectableItem",h,.F.) oItems:SetProperty("SortableItem",h,.F.) oItems:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/) oItems:SetProperty("CellHAlignment",h,0,2/*RightAlignment*/) oItems:SetProperty("FormatCell",h,0,"'<b>HH:NN</b>: '+ (int(value/60) lpad '00') + ':' + ((value mod 60) lpad '00')") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1185 |
Highlight the match once the filter is applied
PROCEDURE OnFilterChange(oGrid) LOCAL format format := oGrid:FormatABC("`lower(value) replace lower('` + value + `') with '<bgcolor 000000><fgcolor FFFFFF>` + value + `</fgcolor></bgcolor>'`",oGrid:FilterBarPromptPattern()) oGrid:Columns:Item(0):FormatColumn := Transform(format,"") oGrid:Columns:Item(1):FormatColumn := Transform(format,"") oGrid:Columns:Item(2):FormatColumn := Transform(format,"") 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 h0 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:FilterChange := {|| OnFilterChange(oGrid)} /*Occurs when filter was changed.*/ oGrid:BeginUpdate() oGrid:SetProperty("SelBackColor",oGrid:BackColor()) oGrid:SetProperty("SelForeColor",oGrid:ForeColor()) oGrid:ColumnAutoResize := .T. oGrid:ContinueColumnScroll := .F. oGrid:MarkSearchColumn := .F. oGrid:SearchColumnIndex := 1 oGrid:HeaderAppearance := 4/*Etched*/ oGrid:HeaderHeight := 23 oGrid:SetProperty("BackColorLevelHeader",oGrid:BackColor()) oGrid:FilterBarCaption := "`<b>` + value + `</b><r><fgcolor=808080>` + ( matchitemcount < 0 ? abs(matchitemcount + 1) + ` result(s)` : ``)" oGrid:FilterBarPromptVisible := 2055/*exFilterBarCompact+exFilterBarCaptionVisible+exFilterBarVisible+exFilterBarPromptVisible*/ oGrid:SetProperty("FilterBarBackColor",oGrid:BackColor()) oGrid:FilterBarPromptPattern := "and" oColumns := oGrid:Columns() oColumn := oColumns:Add("Name") oColumn:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn:FormatColumn := "lower(value)" oColumn1 := oColumns:Add("Title") oColumn1:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn1:FormatColumn := "lower(value)" oColumn2 := oColumns:Add("City") oColumn2:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn2:FormatColumn := "lower(value)" oItems := oGrid:Items() h0 := oItems:AddItem("Nancy Davolio") oItems:SetProperty("CellValue",h0,1,"Sales Representative") oItems:SetProperty("CellValue",h0,2,"Seattle") h0 := oItems:AddItem("Andrew Fuller") oItems:SetProperty("CellValue",h0,1,"Vice President, Sales") oItems:SetProperty("CellValue",h0,2,"Tacoma") oItems:SetProperty("SelectItem",h0,.T.) h0 := oItems:AddItem("Janet Leverling") oItems:SetProperty("CellValue",h0,1,"Sales Representative") oItems:SetProperty("CellValue",h0,2,"Kirkland") h0 := oItems:AddItem("Margaret Peacock") oItems:SetProperty("CellValue",h0,1,"Sales Representative") oItems:SetProperty("CellValue",h0,2,"Redmond") h0 := oItems:AddItem("Steven Buchanan") oItems:SetProperty("CellValue",h0,1,"Sales Manager") oItems:SetProperty("CellValue",h0,2,"London") h0 := oItems:AddItem("Michael Suyama") oItems:SetProperty("CellValue",h0,1,"Sales Representative") oItems:SetProperty("CellValue",h0,2,"London") h0 := oItems:AddItem("Robert King") oItems:SetProperty("CellValue",h0,1,"Sales Representative") oItems:SetProperty("CellValue",h0,2,"London") h0 := oItems:AddItem("Laura Callahan") oItems:SetProperty("CellValue",h0,1,"Inside Sales Coordinator") oItems:SetProperty("CellValue",h0,2,"Seattle") h0 := oItems:AddItem("Anne Dodsworth") oItems:SetProperty("CellValue",h0,1,"Sales Representative") oItems:SetProperty("CellValue",h0,2,"London") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1184 |
The count of filtered items includes the group-parents. How can I exclude them from count
#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:DrawGridLines := 2/*exVLines*/ oGrid:HeaderAppearance := 1/*Flat*/ oGrid:HeaderHeight := 24 oGrid:SortBarHeight := 28 oGrid:SortBarVisible := .T. oGrid:AllowGroupBy := .T. oGrid:Columns():Add("Col 1") oGrid:Columns():Add("Col 2") oItems := oGrid:Items() oItems:SetProperty("CellValue",oItems:AddItem("219 Smith"),1,"Ignacio 1234") oItems:SetProperty("CellValue",oItems:AddItem("1666 County Road 309A"),1,"897 Manassa") oItems:SetProperty("CellValue",oItems:AddItem("38 Lone Pine"),1,"Durango 11") oItems:SetProperty("CellValue",oItems:AddItem("612 Jachim Street"),1,"Lamar 222") oGrid:Layout := "MultipleSort=" + CHR(34) + "C1:1" + CHR(34) + "" oGrid:FilterBarCaption := "`<b>` + value + `</b><r><fgcolor=808080>` + ( matchitemcount < 0 ? leafitemcount + ` result(s)` : ``)" oGrid:FilterBarPromptVisible := 2055/*exFilterBarCompact+exFilterBarCaptionVisible+exFilterBarVisible+exFilterBarPromptVisible*/ oGrid:FilterBarPromptType := 257/*exFilterPromptCaseSensitive+exFilterPromptContainsAll*/ oGrid:FilterBarPromptPattern := "12" oGrid:SetProperty("FilterBarBackColor",oGrid:BackColor()) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1183 |
Is it possible to display the count of filtered items
#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:DrawGridLines := 2/*exVLines*/ oGrid:HeaderAppearance := 4/*Etched*/ oGrid:HeaderHeight := 24 oGrid:Columns():Add("Col 1") oGrid:Columns():Add("Col 2") oItems := oGrid:Items() oItems:SetProperty("CellValue",oItems:AddItem("219 Smith"),1,"Ignacio 1234") oItems:SetProperty("CellValue",oItems:AddItem("1666 County Road 309A"),1,"897 Manassa") oItems:SetProperty("CellValue",oItems:AddItem("38 Lone Pine"),1,"Durango 11") oItems:SetProperty("CellValue",oItems:AddItem("612 Jachim Street"),1,"Lamar 222") oGrid:FilterBarCaption := "`<b>` + value + `</b><r><fgcolor=808080>` + ( matchitemcount < 0 ? abs(matchitemcount + 1) + ` result(s)` : ``)" oGrid:FilterBarPromptVisible := 2055/*exFilterBarCompact+exFilterBarCaptionVisible+exFilterBarVisible+exFilterBarPromptVisible*/ oGrid:FilterBarPromptType := 257/*exFilterPromptCaseSensitive+exFilterPromptContainsAll*/ oGrid:FilterBarPromptPattern := "12" oGrid:SetProperty("FilterBarBackColor",oGrid:BackColor()) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1182 |
GroupBy code
#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:ContinueColumnScroll := .F. oGrid:CountLockedColumns := 1 oGrid:SetProperty("BackColorLock",AutomationTranslateColor( GraMakeRGBColor ( { 248,248,248 } ) , .F. )) oGrid:HasLines := 1/*exSolidLine*/ oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/ rs := CreateObject("ADOR.Recordset") rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/) oGrid:DataSource := rs oGrid:SortBarVisible := .T. oGrid:SingleSort := .F. oGrid:AllowGroupBy := .T. oGrid:Columns:Item(0):Width := 128 oGrid:Layout := "MultipleSort = " + CHR(34) + "C12:1 C1:2" + CHR(34) + "" oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1181 |
ADOR, MDB (JET)
#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. rs := CreateObject("ADOR.Recordset") rs:Open("Orders","Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.mdb",3/*adOpenStatic*/,3/*adLockOptimistic*/) oGrid:DataSource := rs oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1180 |
Editors (ImageSize = 32)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGrid LOCAL oAppearance LOCAL oEditor,oEditor1,oEditor10,oEditor11,oEditor12,oEditor2,oEditor3,oEditor4,oEditor5,oEditor6,oEditor7,oEditor8,oEditor9 LOCAL oItems LOCAL h,oObject 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:ImageSize := 32 oGrid:DefaultItemHeight := 36 oGrid:HeaderHeight := oGrid:DefaultItemHeight() oGrid:SortBarHeight := oGrid:DefaultItemHeight() oGrid:Font():Size := 16 oGrid:FilterBarFont():Size := oGrid:Font():Size() oGrid:ToolTipFont():Size := oGrid:Font():Size() oGrid:Indent := 26 oGrid:Images("gBJJgBAIDAAEg4AEEKAD/hz/EMNh8TIRNGwAjEZAEXjAojKAjMLjABhkaABAk0plUrlktl0vmExmUzmk1m03nE5nU7nk9miAoE+oVDolFo1HpFJpU5h8Sf9OqFNqUOqNUqdPq9VrFWrlbr1QpdhAFAkFis1ntFptVrtkrpszrNvmVxqk3uVtm1kmF3sdBvF/wGBmV+j9BYGHwWJulfxdax2NyFdx2JlV6l9Nw7AAGZymdz2Cy2GxErvWcz9ivlwyV21cuxugwktzGIzmvwtl0+53U5y0a0Wazmmyu/3dCyOMyXHx/J5nIr9q3uyqnBxFN3G46ma4vb7mD2Ng4nZze00fDkHC7t7us2rOX5tguetpHRlmz4HVqnXk1PjHO+CMPo9MBMC+j2vC8j7wS8cFNI4kBo05UIvfCT/NsnsApU+0Fqg/T+oy/kPxC0sEQfErKQK96+w28UWRI8UGvO8sTLS9r2PWmsMJTDTask3CsIbIEQRA3shOXEEAO/GclJ9" +; "FEKrrA8FRbKMXRIlb0JxCkjS1LMswhCcvuel0cv26cSMa8Ufx+2sQwhEUoSXOCjSbLcnxjKc7sdKUVyq28NtVI71P9P7JxtQEapjQ6fzfM8zPfNE2PhIsLL63E40slk5y7N89LcyU9SvMb3SdUc6VJLj5VLVLfO/PS9KzNFHUa/0XyBD0dxlS9cxhMlTRSoNXypPErWDPyfNS+MwprRNO0FD8wVVZ1AI08URwVRjtJ1WCn21QkkUrXVLVPQS/XIkFgTxT9iONZ9xVTdq+L1eKg3kkF6Upe68XtfV51/MtrVjBlwYFL1ev8y1/P6/lyzzYl02wntj0RVFmS1Qa+M5as93QxEUW9e993rfmQ2+vy65M/mL1lhl/2bj2ByVduMtNhCJT9hdz41nN14Ld12Z9UjfI/oUAaGseiw6+uFLLhcVabJOS5RqOE0BHlZ5V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wEwFwGkGcIMCcCpCnCCxiA8NYAAmMJfkSbh" +; "FCcFpFnGDBnBqRpUhuEwTDeZ5lHCfw6HIQxLCaAxygyJwqgGcATE4FA6hWY4tjEAAQBAgIA==") oGrid:SetProperty("BackColorHeader",0x4c6c6c6) oGrid:SetProperty("SelBackColor",0x4000000) oGrid:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oGrid:ShowFocusRect := .F. oGrid:SetProperty("CheckImage",0/*Unchecked*/,16777216) oGrid:SetProperty("CheckImage",1/*Checked*/,33554432) oGrid:SetProperty("CheckImage",2/*PartialChecked*/,50331648) oGrid:Columns():Add("Editors"):SetProperty("Def",17/*exCellValueFormat*/,1) oItems := oGrid:Items() oItems:CellEditor(oItems:AddItem("(ReadOnly)"),0):EditType := 0/*ReadOnly*/ oItems:CellEditor(oItems:AddItem("(EditType)"),0):EditType := 1/*EditType*/ h := oItems:AddItem("Value 1") oEditor := oItems:CellEditor(h,0) oEditor:EditType := 2/*DropDownType*/ oEditor:AddItem(1,"Value 1",1) oEditor:AddItem(2,"Value 2",2) oEditor:AddItem(3,"Value 3",3) oItems:SetProperty("FormatCell",h,0,"value + ' (DropDownType)'") h := oItems:AddItem(1) oEditor1 := oItems:CellEditor(h,0) oEditor1:EditType := 3/*DropDownListType*/ oEditor1:DropDownAutoWidth := 0/*exDropDownEditorWidth*/ oEditor1:AddItem(1,"Nancy Davolio",1) oEditor1:AddItem(2,"Andrew Fuller",2) oEditor1:AddItem(3,"Janet Leverling",3) oEditor1:AddItem(4,"Peacock Margaret",3) oEditor1:AddItem(5,"Steven Buchanan",2) oEditor1:AddItem(6,"Michael Suyama",1) oEditor1:AddItem(7,"Robert King",2) oEditor1:AddItem(8,"Laura Callahan",3) oEditor1:AddItem(9,"Anne Dodsworth",2) oItems:SetProperty("FormatCell",h,0,"value + ' (DropDownList - single column list)'") h := oItems:AddItem(1) oEditor2 := oItems:CellEditor(h,0) oEditor2:EditType := 3/*DropDownListType*/ oEditor2:DropDownAutoWidth := 0/*exDropDownEditorWidth*/ oEditor2:AddItem(1,"Nancy Davolio",1) oEditor2:AddItem(2,"Andrew Fuller",2) oEditor2:InsertItem(3,"Janet Leverling",3,2) oEditor2:InsertItem(4,"Peacock Margaret",3,2) oEditor2:InsertItem(5,"Steven Buchanan",2,2) oEditor2:InsertItem(6,"Michael Suyama",1,5) oEditor2:InsertItem(7,"Robert King",2,2) oEditor2:InsertItem(8,"Laura Callahan",3,2) oEditor2:InsertItem(9,"Anne Dodsworth",2,5) oEditor2:ExpandAll() oItems:SetProperty("FormatCell",h,0,"value + ' (DropDownList - single column tree)'") h := oItems:AddItem(1) oEditor3 := oItems:CellEditor(h,0) oEditor3:EditType := 3/*DropDownListType*/ oEditor3:DropDownAutoWidth := 0/*exDropDownEditorWidth*/ oEditor3:SetProperty("Option",57/*exDropDownColumnCaption*/,"Name¦Title¦City¦Phone") oEditor3:SetProperty("Option",58/*exDropDownColumnWidth*/,"312¦¦¦96") oEditor3:AddItem(1,"Nancy Davolio¦Sales Representative¦Seattle¦(206) 555-9857",1) oEditor3:AddItem(2,"Andrew Fuller¦<b>Vice President</b>, Sales¦Tacoma¦(206) 555-9482",2) oEditor3:AddItem(3,"Janet Leverling¦Sales Representative¦Kirkland¦(206) 555-3412",3) oEditor3:AddItem(4,"Peacock Margaret¦Sales Representative¦Redmond¦(206) 555-8122",3) oEditor3:AddItem(5,"Steven Buchanan¦Sales Manager¦London¦(71) 555-4848",2) oEditor3:AddItem(6,"Michael Suyama¦Sales Representative¦London¦(71) 555-7773",1) oEditor3:AddItem(7,"Robert King¦Sales Representative¦Kirkland¦(71) 555-5598",2) oEditor3:AddItem(8,"Laura Callahan¦Inside Sales Coordinator¦Seattle¦(206) 555-1189",3) oEditor3:AddItem(9,"Anne Dodsworth¦Sales Representative¦London¦(71) 555-4444",2) oItems:SetProperty("FormatCell",h,0,"value + ' (DropDownList - multiple columns list)'") h := oItems:AddItem(1) oEditor4 := oItems:CellEditor(h,0) oEditor4:EditType := 3/*DropDownListType*/ oEditor4:DropDownAutoWidth := 0/*exDropDownEditorWidth*/ oEditor4:SetProperty("Option",57/*exDropDownColumnCaption*/,"Name¦Title¦City¦Phone") oEditor4:SetProperty("Option",58/*exDropDownColumnWidth*/,"312¦¦¦96") oEditor4:AddItem(1,"Nancy Davolio¦Sales Representative¦Seattle¦(206) 555-9857",1) oEditor4:AddItem(2,"Andrew Fuller¦<b>Vice President</b>, Sales¦Tacoma¦(206) 555-9482",2) oEditor4:InsertItem(3,"Janet Leverling¦Sales Representative¦Kirkland¦(206) 555-3412",3,2) oEditor4:InsertItem(4,"Peacock Margaret¦Sales Representative¦Redmond¦(206) 555-8122",3,2) oEditor4:InsertItem(5,"Steven Buchanan¦Sales Manager¦London¦(71) 555-4848",2,2) oEditor4:InsertItem(6,"Michael Suyama¦Sales Representative¦London¦(71) 555-7773",1,5) oEditor4:InsertItem(7,"Robert King¦Sales Representative¦Kirkland¦(71) 555-5598",2,2) oEditor4:InsertItem(8,"Laura Callahan¦Inside Sales Coordinator¦Seattle¦(206) 555-1189",3,2) oEditor4:InsertItem(9,"Anne Dodsworth¦Sales Representative¦London¦(71) 555-4444",2,5) oEditor4:ExpandAll() oItems:SetProperty("FormatCell",h,0,"value + ' (DropDownList - multiple columns tree)'") h := oItems:AddItem(100) oItems:CellEditor(h,0):EditType := 4/*SpinType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (SpinType)'") oItems:CellEditor(oItems:AddItem("(MemoType)"),0):EditType := 5/*MemoType*/ h := oItems:AddItem(3) oEditor5 := oItems:CellEditor(h,0) oEditor5:EditType := 6/*CheckListType*/ oEditor5:AddItem(1,"Border",1) oEditor5:AddItem(2,"Single",2) oEditor5:AddItem(4,"Frame",3) oItems:SetProperty("FormatCell",h,0,"value + ' (CheckListType)'") h := oItems:AddItem("193.226.40.161") oEditor6 := oItems:CellEditor(h,0) oEditor6:Mask := "{0,255}.{0,255}.{0,255}.{0,255}" oEditor6:EditType := 8/*MaskType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (MaskType)'") h := oItems:AddItem(65280) oEditor7 := oItems:CellEditor(h,0) oEditor7:EditType := 9/*ColorType*/ oEditor7:Mask := "`RGB(`{0,255}\,{0,255}\,{0,255}`)`;;0" oItems:SetProperty("FormatCell",h,0,"value + ' (ColorType)'") h := oItems:AddItem("Tahoma") oItems:CellEditor(h,0):EditType := 10/*FontType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (FontType)'") h := oItems:AddItem("gBHJJGHA5MIwAEIe4AAAFhwbiAliQwig7ixFjBQjRbjhljxwkB7kSFkiQkyblCllSwli7lzFmDQmTbmjlmzwnD7nQBnk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1YhgAEL5AgBhj/AAssMJthABFof4JDhIWCgYKDBATFT8M6hUIFAQAEQCCDwYF/QoWDZCRBgOKgIYHCQXMisKBAEQAAgOBZaSgQhjERANKQiZhIWamYyIBQ6FzcNKxQLJT4ADA4RjwObAAidBYdHwABQgUxMQYZEI0cD4OgnYKaKyzIRFNQx2YCKoFHScYD0ADXQwUAgwLoLQDqaCWBJoNQ9NBxFJTVQORgiarqSABbamGwtDAwBUWhQmqYALnOFQvGYPA4m6AwKhkZxKj2PBWC0SZCgmVY6CwIJgieBAniubRKHgaYgiwQwGiCfxGDWbBRmGZYIi2VwGnAexxGUSwUFiaR+hQPbBgOCoLCIHh4DAARCmQ" +; "G4AlgNxuhwWgpFAEQUhuOxOk0NrhAaQoBmgPYdFSIZPjYGYbn+HhgEoAA7HMBIOjUM51AoPojHkEwVlET5slgWZtAEUBdjeSoeF6X5/rQRRSi+QB6GychsEAfZshKYABGQZorlAOgMBqEgAjYHB2jqSoigmYBLk+QZnBqGhggAEwImgbojgoIwSE+MxUHiS4REQCQWluD48B+JJoL+YQikuaI9AALgLmsJQfnSdAvDkCJEhIIIBgOegLEiPBqCyCAAjcCwgAAIJBhQBQkHGL4gDaNBokkZQMiwUAuioJQiCAQYsHMcwwEIeoigAYIogsGIwFKIYICIWguEoPgQhsawBASGgwCuJwLH8K4LigAIaDwbxMAOKxbisPwfASQATFASoagIEYwgcSoKGiAA/mEdIuiGPxCmObIlhMIJNHONxFH8EpPCGeB+noEpBBSSRjCsPZEiyKhgjAH5whSdLEjwDxjC8TxVEMFRzFWJJZBUSI0gQEQLBOM4VHkIg1D0CA" +; "JDQNg/p4AAdoC") oItems:CellEditor(h,0):EditType := 11/*PictureType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (PictureType)'") oItems:CellEditor(oItems:AddItem("(ButtonType)"),0):EditType := 12/*ButtonType*/ h := oItems:AddItem(25) oItems:CellEditor(h,0):EditType := 13/*ProgressBarType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (ProgressBarType)'") h := oItems:AddItem("Value 1") oEditor8 := oItems:CellEditor(h,0) oEditor8:EditType := 14/*PickEditType*/ oEditor8:AddItem(1,"Value 1",1) oEditor8:AddItem(2,"Value 2",2) oEditor8:AddItem(3,"Value 3",3) oItems:SetProperty("FormatCell",h,0,"value + ' (PickEditType)'") oItems:CellEditor(oItems:AddItem("(LinkEditType)"),0):EditType := 15/*LinkEditType*/ oEditor9 := oItems:CellEditor(oItems:AddItem("(UserEditorType)"),0) oEditor9:EditType := 16/*UserEditorType*/ oEditor9:UserEditor("Exontrol.ComboBox","") oObject := oEditor9:UserEditorObject() h := oItems:AddItem(255) oEditor10 := oItems:CellEditor(h,0) oEditor10:EditType := 17/*ColorListType*/ oEditor10:SetProperty("Option",4/*exColorListShowName*/,.T.) oItems:SetProperty("FormatCell",h,0,"value + ' (ColorListType)'") oItems:CellEditor(oItems:AddItem(65280),0):EditType := 17/*ColorListType*/ oItems:CellEditor(oItems:AddItem("(MemoDropDownType)"),0):EditType := 18/*MemoDropDownType*/ oEditor11 := oItems:CellEditor(oItems:AddItem(-1),0) oEditor11:EditType := 19/*CheckValueType*/ oEditor11:SetProperty("Option",17/*exCheckValue2*/,1) h := oItems:AddItem(50) oEditor12 := oItems:CellEditor(h,0) oEditor12:EditType := 20/*SliderType*/ oEditor12:SetProperty("Option",41/*exSliderWidth*/,-60) oEditor12:SetProperty("Option",53/*exSliderTickFrequency*/,10) oEditor12:SetProperty("Option",63/*exSliderTickStyle*/,2) oItems:SetProperty("FormatCell",h,0,"value + ' (SliderType)'") h := oItems:AddItem(100) oItems:CellEditor(h,0):EditType := 21/*CalculatorType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (CalculatorType)'") oItems:EnsureVisibleItem(h) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1179 |
Editors (ImageSize = 16, default)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGrid LOCAL oAppearance LOCAL oEditor,oEditor1,oEditor10,oEditor11,oEditor12,oEditor2,oEditor3,oEditor4,oEditor5,oEditor6,oEditor7,oEditor8,oEditor9 LOCAL oItems LOCAL h,oObject 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:ImageSize := 16 oGrid:Images("gBJJgBAIDAAEg4ACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjMLjABAAgjUYkUnlUrlktl0vmExmUzmk1m03nE5nU7nkrQCAntBoVDolFo1HoM/ADAplLptImdMYFOqdSqlXq1QrVbrlGpVWsFNrNdnNjsk7pQAtNroFnt0sh8Yr9iulTuNxs1Eu8OiT/vsnsNVutXlk/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gggJgKgKYJIDSVoDk8KBFF4OohEMZgWDs" +; "YYDj4GoGmGSB2B6B5iAiBgYDsYRjGSbIJo4RgqDuIpIAoLoLmMCJGDKDJjJiLA7xqUAAgGTwYnYPoPmQCQGEKEJkEkFg9gGY44BoRoSmSSQ2EKEggHgRhShSZRJFYVoVmWCRmFKFAgGOTheheZgJgYYoYmYSYWGaF4lkMMJ0hqZpJjYbobmcCZGHKHJmjmJh0h2Z4JmYcIaE8WZ2H6H5oAoBoCiCaBKBYfdjGoJoKiKaJKDaDojmkChGgmIgpCoVoWiWaJZiSd4mmmSh2h6J5qAqBoiiiaY5iSeIpmqComiqKpqkqNouiuah6hqMIsmsSpWiuGhP1kOoumuSp2j6L5sAsBo54gKwWkaMZsgsJpKjKbJLDaRYxYWRpSjSbIZiSe41m2CxmlqNptksdpejebR5iSfI4m4S4W16boLiaao6m5fJ9jubwLkaco8m8S5WnaPZunuOp4j6b5Lnac4SA0PAGlgP4wEwFwGkGcIMCcCpCnCCxiA8NYAAmMJfkSbh" +; "FCcFpFnGDBnBqRpUhuEwTDeZ5lHCfw6HIQxLCaAxygyJwqgGcATE4FA6hWY4tjEAAQBAgIA==") oGrid:Columns():Add("Editors"):SetProperty("Def",17/*exCellValueFormat*/,1) oGrid:SetProperty("BackColorHeader",0x4c6c6c6) oItems := oGrid:Items() oItems:CellEditor(oItems:AddItem("(ReadOnly)"),0):EditType := 0/*ReadOnly*/ oItems:CellEditor(oItems:AddItem("(EditType)"),0):EditType := 1/*EditType*/ h := oItems:AddItem("Value 1") oEditor := oItems:CellEditor(h,0) oEditor:EditType := 2/*DropDownType*/ oEditor:AddItem(1,"Value 1",1) oEditor:AddItem(2,"Value 2",2) oEditor:AddItem(3,"Value 3",3) oItems:SetProperty("FormatCell",h,0,"value + ' (DropDownType)'") h := oItems:AddItem(1) oEditor1 := oItems:CellEditor(h,0) oEditor1:EditType := 3/*DropDownListType*/ oEditor1:DropDownAutoWidth := 0/*exDropDownEditorWidth*/ oEditor1:AddItem(1,"Nancy Davolio",1) oEditor1:AddItem(2,"Andrew Fuller",2) oEditor1:AddItem(3,"Janet Leverling",3) oEditor1:AddItem(4,"Peacock Margaret",3) oEditor1:AddItem(5,"Steven Buchanan",2) oEditor1:AddItem(6,"Michael Suyama",1) oEditor1:AddItem(7,"Robert King",2) oEditor1:AddItem(8,"Laura Callahan",3) oEditor1:AddItem(9,"Anne Dodsworth",2) oItems:SetProperty("FormatCell",h,0,"value + ' (DropDownList - single column list)'") h := oItems:AddItem(1) oEditor2 := oItems:CellEditor(h,0) oEditor2:EditType := 3/*DropDownListType*/ oEditor2:DropDownAutoWidth := 0/*exDropDownEditorWidth*/ oEditor2:AddItem(1,"Nancy Davolio",1) oEditor2:AddItem(2,"Andrew Fuller",2) oEditor2:InsertItem(3,"Janet Leverling",3,2) oEditor2:InsertItem(4,"Peacock Margaret",3,2) oEditor2:InsertItem(5,"Steven Buchanan",2,2) oEditor2:InsertItem(6,"Michael Suyama",1,5) oEditor2:InsertItem(7,"Robert King",2,2) oEditor2:InsertItem(8,"Laura Callahan",3,2) oEditor2:InsertItem(9,"Anne Dodsworth",2,5) oEditor2:ExpandAll() oItems:SetProperty("FormatCell",h,0,"value + ' (DropDownList - single column tree)'") h := oItems:AddItem(1) oEditor3 := oItems:CellEditor(h,0) oEditor3:EditType := 3/*DropDownListType*/ oEditor3:DropDownAutoWidth := 0/*exDropDownEditorWidth*/ oEditor3:SetProperty("Option",57/*exDropDownColumnCaption*/,"Name¦Title¦City¦Phone") oEditor3:SetProperty("Option",58/*exDropDownColumnWidth*/,"312¦¦¦96") oEditor3:AddItem(1,"Nancy Davolio¦Sales Representative¦Seattle¦(206) 555-9857",1) oEditor3:AddItem(2,"Andrew Fuller¦<b>Vice President</b>, Sales¦Tacoma¦(206) 555-9482",2) oEditor3:AddItem(3,"Janet Leverling¦Sales Representative¦Kirkland¦(206) 555-3412",3) oEditor3:AddItem(4,"Peacock Margaret¦Sales Representative¦Redmond¦(206) 555-8122",3) oEditor3:AddItem(5,"Steven Buchanan¦Sales Manager¦London¦(71) 555-4848",2) oEditor3:AddItem(6,"Michael Suyama¦Sales Representative¦London¦(71) 555-7773",1) oEditor3:AddItem(7,"Robert King¦Sales Representative¦Kirkland¦(71) 555-5598",2) oEditor3:AddItem(8,"Laura Callahan¦Inside Sales Coordinator¦Seattle¦(206) 555-1189",3) oEditor3:AddItem(9,"Anne Dodsworth¦Sales Representative¦London¦(71) 555-4444",2) oItems:SetProperty("FormatCell",h,0,"value + ' (DropDownList - multiple columns list)'") h := oItems:AddItem(1) oEditor4 := oItems:CellEditor(h,0) oEditor4:EditType := 3/*DropDownListType*/ oEditor4:DropDownAutoWidth := 0/*exDropDownEditorWidth*/ oEditor4:SetProperty("Option",57/*exDropDownColumnCaption*/,"Name¦Title¦City¦Phone") oEditor4:SetProperty("Option",58/*exDropDownColumnWidth*/,"312¦¦¦96") oEditor4:AddItem(1,"Nancy Davolio¦Sales Representative¦Seattle¦(206) 555-9857",1) oEditor4:AddItem(2,"Andrew Fuller¦<b>Vice President</b>, Sales¦Tacoma¦(206) 555-9482",2) oEditor4:InsertItem(3,"Janet Leverling¦Sales Representative¦Kirkland¦(206) 555-3412",3,2) oEditor4:InsertItem(4,"Peacock Margaret¦Sales Representative¦Redmond¦(206) 555-8122",3,2) oEditor4:InsertItem(5,"Steven Buchanan¦Sales Manager¦London¦(71) 555-4848",2,2) oEditor4:InsertItem(6,"Michael Suyama¦Sales Representative¦London¦(71) 555-7773",1,5) oEditor4:InsertItem(7,"Robert King¦Sales Representative¦Kirkland¦(71) 555-5598",2,2) oEditor4:InsertItem(8,"Laura Callahan¦Inside Sales Coordinator¦Seattle¦(206) 555-1189",3,2) oEditor4:InsertItem(9,"Anne Dodsworth¦Sales Representative¦London¦(71) 555-4444",2,5) oEditor4:ExpandAll() oItems:SetProperty("FormatCell",h,0,"value + ' (DropDownList - multiple columns tree)'") h := oItems:AddItem(100) oItems:CellEditor(h,0):EditType := 4/*SpinType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (SpinType)'") oItems:CellEditor(oItems:AddItem("(MemoType)"),0):EditType := 5/*MemoType*/ h := oItems:AddItem(3) oEditor5 := oItems:CellEditor(h,0) oEditor5:EditType := 6/*CheckListType*/ oEditor5:AddItem(1,"Border",1) oEditor5:AddItem(2,"Single",2) oEditor5:AddItem(4,"Frame",3) oItems:SetProperty("FormatCell",h,0,"value + ' (CheckListType)'") h := oItems:AddItem("193.226.40.161") oEditor6 := oItems:CellEditor(h,0) oEditor6:Mask := "{0,255}.{0,255}.{0,255}.{0,255}" oEditor6:EditType := 8/*MaskType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (MaskType)'") h := oItems:AddItem(65280) oEditor7 := oItems:CellEditor(h,0) oEditor7:EditType := 9/*ColorType*/ oEditor7:Mask := "`RGB(`{0,255}\,{0,255}\,{0,255}`)`;;0" oItems:SetProperty("FormatCell",h,0,"value + ' (ColorType)'") h := oItems:AddItem("Tahoma") oItems:CellEditor(h,0):EditType := 10/*FontType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (FontType)'") h := oItems:AddItem("gBHJJGHA5MIwAEIe4AAAFhwbiAliQwig7ixFjBQjRbjhljxwkB7kSFkiQkyblCllSwli7lzFmDQmTbmjlmzwnD7nQBnk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1YhgAEL5AgBhj/AAssMJthABFof4JDhIWCgYKDBATFT8M6hUIFAQAEQCCDwYF/QoWDZCRBgOKgIYHCQXMisKBAEQAAgOBZaSgQhjERANKQiZhIWamYyIBQ6FzcNKxQLJT4ADA4RjwObAAidBYdHwABQgUxMQYZEI0cD4OgnYKaKyzIRFNQx2YCKoFHScYD0ADXQwUAgwLoLQDqaCWBJoNQ9NBxFJTVQORgiarqSABbamGwtDAwBUWhQmqYALnOFQvGYPA4m6AwKhkZxKj2PBWC0SZCgmVY6CwIJgieBAniubRKHgaYgiwQwGiCfxGDWbBRmGZYIi2VwGnAexxGUSwUFiaR+hQPbBgOCoLCIHh4DAARCmQ" +; "G4AlgNxuhwWgpFAEQUhuOxOk0NrhAaQoBmgPYdFSIZPjYGYbn+HhgEoAA7HMBIOjUM51AoPojHkEwVlET5slgWZtAEUBdjeSoeF6X5/rQRRSi+QB6GychsEAfZshKYABGQZorlAOgMBqEgAjYHB2jqSoigmYBLk+QZnBqGhggAEwImgbojgoIwSE+MxUHiS4REQCQWluD48B+JJoL+YQikuaI9AALgLmsJQfnSdAvDkCJEhIIIBgOegLEiPBqCyCAAjcCwgAAIJBhQBQkHGL4gDaNBokkZQMiwUAuioJQiCAQYsHMcwwEIeoigAYIogsGIwFKIYICIWguEoPgQhsawBASGgwCuJwLH8K4LigAIaDwbxMAOKxbisPwfASQATFASoagIEYwgcSoKGiAA/mEdIuiGPxCmObIlhMIJNHONxFH8EpPCGeB+noEpBBSSRjCsPZEiyKhgjAH5whSdLEjwDxjC8TxVEMFRzFWJJZBUSI0gQEQLBOM4VHkIg1D0CA" +; "JDQNg/p4AAdoC") oItems:CellEditor(h,0):EditType := 11/*PictureType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (PictureType)'") oItems:CellEditor(oItems:AddItem("(ButtonType)"),0):EditType := 12/*ButtonType*/ h := oItems:AddItem(25) oItems:CellEditor(h,0):EditType := 13/*ProgressBarType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (ProgressBarType)'") h := oItems:AddItem("Value 1") oEditor8 := oItems:CellEditor(h,0) oEditor8:EditType := 14/*PickEditType*/ oEditor8:AddItem(1,"Value 1",1) oEditor8:AddItem(2,"Value 2",2) oEditor8:AddItem(3,"Value 3",3) oItems:SetProperty("FormatCell",h,0,"value + ' (PickEditType)'") oItems:CellEditor(oItems:AddItem("(LinkEditType)"),0):EditType := 15/*LinkEditType*/ oEditor9 := oItems:CellEditor(oItems:AddItem("(UserEditorType)"),0) oEditor9:EditType := 16/*UserEditorType*/ oEditor9:UserEditor("Exontrol.ComboBox","") oObject := oEditor9:UserEditorObject() h := oItems:AddItem(255) oEditor10 := oItems:CellEditor(h,0) oEditor10:EditType := 17/*ColorListType*/ oEditor10:SetProperty("Option",4/*exColorListShowName*/,.T.) oItems:SetProperty("FormatCell",h,0,"value + ' (ColorListType)'") oItems:CellEditor(oItems:AddItem(65280),0):EditType := 17/*ColorListType*/ oItems:CellEditor(oItems:AddItem("(MemoDropDownType)"),0):EditType := 18/*MemoDropDownType*/ oEditor11 := oItems:CellEditor(oItems:AddItem(-1),0) oEditor11:EditType := 19/*CheckValueType*/ oEditor11:SetProperty("Option",17/*exCheckValue2*/,1) h := oItems:AddItem(50) oEditor12 := oItems:CellEditor(h,0) oEditor12:EditType := 20/*SliderType*/ oEditor12:SetProperty("Option",41/*exSliderWidth*/,-60) oEditor12:SetProperty("Option",53/*exSliderTickFrequency*/,10) oEditor12:SetProperty("Option",63/*exSliderTickStyle*/,2) oItems:SetProperty("FormatCell",h,0,"value + ' (SliderType)'") h := oItems:AddItem(100) oItems:CellEditor(h,0):EditType := 21/*CalculatorType*/ oItems:SetProperty("FormatCell",h,0,"value + ' (CalculatorType)'") oItems:EnsureVisibleItem(h) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1178 |
Re-order the cell's caption, icons and images/pictures
#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 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:Images("gBJJgBAICAADAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEahkZAIAEEbjMjlErlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrlTiFdib/sNjr9gs1nldlrlqtFtt0stlguNvulyh91ud1vVVvNuvt7wFHr9/vl3luEwOJouIq+Dw2KyGRyWTymVy2XzGZzUuiw+lmej0gkUaksljaAnmDcD/cEbf7w1+ufD/fEbeB028bYAO3enB6AB++4EoA4A4sb4vHjXJ4nG5vKAHA4ca6XBjTAD/Y2x/eB/jcB") oColumn := oGrid:Columns():Add("ToLeft") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn1 := oGrid:Columns():Add("ToRight") oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn1:SetProperty("Def",34/*exCellDrawPartsOrder*/,"caption,picture,icons,icon,check") oGrid:DefaultItemHeight := 32 oGrid:DrawGridLines := 2/*exVLines*/ oGrid:HeaderAppearance := 4/*Etched*/ oItems := oGrid:Items() h := oItems:AddItem("Caption") oItems:SetProperty("CellImage",h,0,2) oItems:SetProperty("CellImages",h,0,"1,2") oItems:SetProperty("CellPicture",h,0,oGrid:ExecuteTemplate("loadpicture(`gCJKBOI4NBQaBQAhQNJJIIhShQAEEREAIA0ROZ6PT0hQKYZpIZDKBJkIgKByN5mNJsMsKPABVqXBI4KjrD7HL6GWKPJKiCIhMiySidKxbOzZZJWMLsGL2FqyLjZMonNa2CyiZDOUqsQqUEq0ZCNISFXDIFxzZ4hUrbdrefZ/fz3ZgzZ75Tz3XjvHZnZznPieb55AKgAqmRyOOzEhR7XirWaWQQMTa+QIhDbZOZAAoYUCPDAQG7FXI4JRrNCoIRdPyyFr0AYifDUKZ+PCufK4RReALLUbtdBHSrGTCCNKqT4MbRqUxxQx+CAAEQ2VCBbxqGaLYDZNgzFbCbLDarRCrqMYMM6cWqpHKUDqh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3LEfgCLYIgQNYgw4IQiSaBcAABBEAB/DAXS4HgPAgLUSCzGkPjkIATyXPQoCeNYfR6Do7QGI8Zj+CAHiyCY2SkIQTSSCIyDQCkpDBJQJinMMuAUPgOxGOcpA/AkoTzJwyiYFMiDwJEsShFAURFCwJRVFceQXKQIS8P8STlBgLggAcrAQCQATjIgZA0JgVSxL0OAmKI6CpEc4SuOkeBeOwMRnLQuQhOApDJAImYmD44BPIgAzFMYiR3LcQw4JwqhQAknAMFAxwEEwJwUO4ljCHgmxzNwNQ3EU3ScLYEAACocDePwZgCLI+yFN8jg7FEQTtKMcwrAAOhgHw6SQI4OCmJgjDmNAjj" +; "5Gw+wbHkkTpEw7gpFgIAA2sABJEUThEK4QhgIJAQ==`)")) oItems:SetProperty("CellValue",h,1,oItems:CellValue(h,0)) oItems:SetProperty("CellHAlignment",h,1,2/*RightAlignment*/) oItems:SetProperty("CellImage",h,1,oItems:CellImage(h,0)) oItems:SetProperty("CellImages",h,1,"2,1") oItems:SetProperty("CellPicture",h,1,oItems:CellPicture(h,0)) h := oItems:AddItem("<b>HTML</b> <off 4>Caption") oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/) oItems:SetProperty("CellImage",h,0,2) oItems:SetProperty("CellImages",h,0,"1,2") oItems:SetProperty("CellPicture",h,0,oGrid:ExecuteTemplate("loadpicture(`gCJKBOI4NBQaBQAhQNJJIIhShQAEEREAIA0ROZ6PT0hQKYZpIZDKBJkIgKByN5mNJsMsKPABVqXBI4KjrD7HL6GWKPJKiCIhMiySidKxbOzZZJWMLsGL2FqyLjZMonNa2CyiZDOUqsQqUEq0ZCNISFXDIFxzZ4hUrbdrefZ/fz3ZgzZ75Tz3XjvHZnZznPieb55AKgAqmRyOOzEhR7XirWaWQQMTa+QIhDbZOZAAoYUCPDAQG7FXI4JRrNCoIRdPyyFr0AYifDUKZ+PCufK4RReALLUbtdBHSrGTCCNKqT4MbRqUxxQx+CAAEQ2VCBbxqGaLYDZNgzFbCbLDarRCrq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AaoQHQYocBiaHtJT3LEfgCLYIgQNYgw4IQiSaBcAABBEAB/DAXS4HgPAgLUSCzGkPjkIATyXPQoCeNYfR6Do7QGI8Zj+CAHiyCY2SkIQTSSCIyDQCkpDBJQJinMMuAUPgOxGOcpA/AkoTzJwyiYFMiDwJEsShFAURFCwJRVFceQXKQIS8P8STlBgLggAcrAQCQATjIgZA0JgVSxL0OAmKI6CpEc4SuOkeBeOwMRnLQuQhOApDJAImYmD44BPIgAzFMYiR3LcQw4JwqhQAknAMFAxwEEwJwUO4ljCHgmxzNwNQ3EU3ScLYEAACocDePwZgCLI+yFN8jg7FEQTtKMcwrAAOhgHw6SQI4OCmJgjDmNAjj" +; "5Gw+wbHkkTpEw7gpFgIAA2sABJEUThEK4QhgIJAQ==`)")) oItems:SetProperty("CellValue",h,1,oItems:CellValue(h,0)) oItems:SetProperty("CellValueFormat",h,1,1/*exHTML*/) oItems:SetProperty("CellHAlignment",h,1,2/*RightAlignment*/) oItems:SetProperty("CellImage",h,1,oItems:CellImage(h,0)) oItems:SetProperty("CellImages",h,1,"2,1") oItems:SetProperty("CellPicture",h,1,oItems:CellPicture(h,0)) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1177 |
ImageSize property on 32 (specifies the size of control' icons/images/check-boxes/radio-buttons)
PROCEDURE OnAddColumn(oGrid,Column) /*Column.Def(48) = 2*/ /*Column.Def(49) = 2*/ RETURN #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,oColumn1,oColumn2,oColumn3 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:AddColumn := {|Column| OnAddColumn(oGrid,Column)} /*Fired after a new column has been added.*/ oGrid:BeginUpdate() oGrid:ImageSize := 32 oGrid:DefaultItemHeight := 36 oGrid:HeaderHeight := oGrid:DefaultItemHeight() oGrid:SortBarHeight := oGrid:DefaultItemHeight() oGrid:Font():Size := 16 oGrid:FilterBarFont():Size := oGrid:Font():Size() oGrid:ToolTipFont():Size := oGrid:Font():Size() oGrid:Indent := 26 oGrid:Images("gBJJgBAIDAAEg4AEEKAD/hz/EMNh8TIRNGwAjEZAEXjAojKAjMLjABhkaABAk0plUrlktl0vmExmUzmk1m03nE5nU7nk9miAoE+oVDolFo1HpFJpU5h8Sf9OqFNqUOqNUqdPq9VrFWrlbr1QpdhAFAkFis1ntFptVrtkrpszrNvmVxqk3uVtm1kmF3sdBvF/wGBmV+j9BYGHwWJulfxdax2NyFdx2JlV6l9Nw7AAGZymdz2Cy2GxErvWcz9ivlwyV21cuxugwktzGIzmvwtl0+53U5y0a0Wazmmyu/3dCyOMyXHx/J5nIr9q3uyqnBxFN3G46ma4vb7mD2Ng4nZze00fDkHC7t7us2rOX5tguetpHRlmz4HVqnXk1PjHO+CMPo9MBMC+j2vC8j7wS8cFNI4kBo05UIvfCT/NsnsApU+0Fqg/T+oy/kPxC0sEQfErKQK96+w28UWRI8UGvO8sTLS9r2PWmsMJTDTask3CsIbIEQRA3shOXEEAO/GclJ9" +; "FEKrrA8FRbKMXRIlb0JxCkjS1LMswhCcvuel0cv26cSMa8Ufx+2sQwhEUoSXOCjSbLcnxjKc7sdKUVyq28NtVI71P9P7JxtQEapjQ6fzfM8zPfNE2PhIsLL63E40slk5y7N89LcyU9SvMb3SdUc6VJLj5VLVLfO/PS9KzNFHUa/0XyBD0dxlS9cxhMlTRSoN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aBKBYfdjGoJoKiKaJKDaDojmkChGgmIgpCoVoWiWaJZiSd4mmmSh2h6J5qAqBoiiiaY5iSeIpmqComiqKpqkqNouiuah6hqMIsmsSpWiuGhP1kOoumuSp2j6L5sAsBo54gKwWkaMZsgsJpKjKbJLDaRYxYWRpSjSbIZiSe41m2CxmlqNptksdpejebR5iSfI4m4S4W16boLiaao6m5fJ9jubwLkaco8m8S5WnaPZunuOp4j6b5Lnac4SA0PAGlgP4wEwFwGkGcIMCcCpCnCCxiA8NYAAmMJfkSbh" +; "FCcFpFnGDBnBqRpUhuEwTDeZ5lHCfw6HIQxLCaAxygyJwqgGcATE4FA6hWY4tjEAAQBAgIA==") oGrid:SetProperty("BackColorHeader",0x4c6c6c6) oGrid:SetProperty("SelBackColor",0x4000000) oGrid:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oGrid:SetProperty("CheckImage",0/*Unchecked*/,16777216) oGrid:SetProperty("CheckImage",1/*Checked*/,33554432) oGrid:SetProperty("CheckImage",2/*PartialChecked*/,50331648) oGrid:SetProperty("Background",20/*exSelBackColorFilter*/,oGrid:SelBackColor()) oGrid:SetProperty("Background",21/*exSelForeColorFilter*/,oGrid:SelForeColor()) oGrid:SetProperty("Background",26/*exBackColorFilter*/,oGrid:BackColor()) oGrid:SetProperty("Background",27/*exForeColorFilter*/,oGrid:ForeColor()) oGrid:SetProperty("Background",32/*exCursorHoverColumn*/,-1) oGrid:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x4000000) oGrid:SetProperty("Background",41/*exHeaderFilterBarActive*/,0x4010101) oGrid:SetProperty("Background",1/*exFooterFilterBarButton*/,0x40000ff) oGrid:HeaderAppearance := 4/*Etched*/ oGrid:ShowFocusRect := .F. oGrid:SortBarVisible := .T. oGrid:AllowGroupBy := .T. oGrid:SetProperty("BackColorSortBar",oGrid:BackColor()) oGrid:SetProperty("BackColorLevelHeader",oGrid:BackColor()) oGrid:FilterBarDropDownHeight := 1 oColumn := oGrid:Columns():Add("Check") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oColumn:Width := 128 oColumn:DisplayFilterButton := .T. oColumn:FilterList := 256/*exShowCheckBox*/ oColumn1 := oGrid:Columns():Add("Pos") oColumn1:FormatColumn := "1 pos ``" oColumn1:AllowSort := .F. oColumn1:Width := 48 oColumn1:AllowSizing := .F. oColumn1:Alignment := 1/*CenterAlignment*/ oColumn1:HeaderAlignment := 1/*CenterAlignment*/ oColumn2 := oGrid:Columns():Add("Image") oColumn2:DisplayFilterButton := .T. oColumn2:FilterList := 8480/*exShowExclude+exShowCheckBox+exSortItemsAsc*/ oColumn2:FilterType := 10/*exImage*/ oColumn2:DisplayExpandButton := .T. oColumn2:ExpandColumns := "1,2,3" oColumn2:Width := 128 oColumn2:HeaderImage := 1 oColumn3 := oGrid:Columns():Add("Images") oColumn3:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn3:Width := 196 oColumn3:HTMLCaption := "<img>1</img><img>2</img><img>3</img> Images" oGrid:Columns:Item("Pos"):Position := 3 oItems := oGrid:Items() hR := oItems:AddItem("Root") oItems:SetProperty("ItemDivider",hR,0) oItems:SetProperty("ItemDividerLine",hR,0/*EmptyLine*/) h := oItems:InsertItem(hR,,"Child A") oItems:SetProperty("CellImage",h,2,1) oItems:SetProperty("CellImages",h,3,"1,2,3") oItems:SetProperty("CellValue",h,3,"123") h := oItems:InsertItem(hR,,"Child B") oItems:SetProperty("CellState",h,0,1) oItems:SetProperty("CellImage",h,2,3) oItems:SetProperty("CellImages",h,3,"2,3,1") oItems:SetProperty("CellValue",h,3,"231") oItems:SetProperty("SelectItem",h,.T.) h := oItems:InsertItem(hR,,"Child C") oItems:SetProperty("CellImage",h,2,2) oItems:SetProperty("CellState",h,3,1) oItems:SetProperty("CellValue",h,3,"312") oItems:SetProperty("CellImages",h,3,"3,1,2") oItems:SetProperty("ExpandItem",hR,.T.) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1176 |
ImageSize property on 16 (default) (specifies the size of control' icons/images/check-boxes/radio-buttons)
PROCEDURE OnAddColumn(oGrid,Column) /*Column.Def(48) = 2*/ /*Column.Def(49) = 2*/ RETURN #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,oColumn1,oColumn2,oColumn3 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:AddColumn := {|Column| OnAddColumn(oGrid,Column)} /*Fired after a new column has been added.*/ oGrid:BeginUpdate() oGrid:ImageSize := 16 oGrid:Images("gBJJgBAIDAAEg4ACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjMLjABAAgjUYkUnlUrlktl0vmExmUzmk1m03nE5nU7nkrQCAntBoVDolFo1HoM/ADAplLptImdMYFOqdSqlXq1QrVbrlGpVWsFNrNdnNjsk7pQAtNroFnt0sh8Yr9iulTuNxs1Eu8OiT/vsnsNVutXlk/oGGtVKxGLxWNtsZtN8iUYuNvy0Zvd+xNYwdwvl4p870GCqc8vOeuVttmp1knyOayWVy+WzN/ze1wOElenm+12WUz/Bv2/3UyyWrzeutux2GSyGP2dQ33C1ur3GD3M4zUNzHdlWjq/E3nGzVpjWv4HA7fRy/Tv2IrN8rPW6nZ3ve7mUlfu20Z8acvQyb+vY9jasYoDwMm+LytVBDqKG3z8O3Cb8P+m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GHKHJmjmJh0h2Z4JmYcIaE8WZ2H6H5oAoBoCiCaBKBYfdjGoJoKiKaJKDaDojmkChGgmIgpCoVoWiWaJZiSd4mmmSh2h6J5qAqBoiiiaY5iSeIpmqComiqKpqkqNouiuah6hqMIsmsSpWiuGhP1kOoumuSp2j6L5sAsBo54gKwWkaMZsgsJpKjKbJLDaRYxYWRpSjSbIZiSe41m2CxmlqNptksdpejebR5iSfI4m4S4W16boLiaao6m5fJ9jubwLkaco8m8S5WnaPZunuOp4j6b5Lnac4SA0PAGlgP4wEwFwGkGcIMCcCpCnCCxiA8NYAAmMJfkSbh" +; "FCcFpFnGDBnBqRpUhuEwTDeZ5lHCfw6HIQxLCaAxygyJwqgGcATE4FA6hWY4tjEAAQBAgIA==") oGrid:SetProperty("BackColorHeader",0x4c6c6c6) oGrid:SetProperty("SelBackColor",0x4000000) oGrid:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oGrid:SetProperty("Background",20/*exSelBackColorFilter*/,oGrid:SelBackColor()) oGrid:SetProperty("Background",21/*exSelForeColorFilter*/,oGrid:SelForeColor()) oGrid:SetProperty("Background",26/*exBackColorFilter*/,oGrid:BackColor()) oGrid:SetProperty("Background",27/*exForeColorFilter*/,oGrid:ForeColor()) oGrid:SetProperty("Background",32/*exCursorHoverColumn*/,-1) oGrid:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x4000000) oGrid:SetProperty("Background",41/*exHeaderFilterBarActive*/,0x4010101) oGrid:SetProperty("Background",1/*exFooterFilterBarButton*/,0x40000ff) oGrid:HeaderAppearance := 4/*Etched*/ oGrid:ShowFocusRect := .F. oGrid:SortBarVisible := .T. oGrid:AllowGroupBy := .T. oGrid:SetProperty("BackColorSortBar",oGrid:BackColor()) oGrid:SetProperty("BackColorLevelHeader",oGrid:BackColor()) oGrid:FilterBarDropDownHeight := 1 oColumn := oGrid:Columns():Add("Check") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oColumn:Width := 128 oColumn:DisplayFilterButton := .T. oColumn:FilterList := 256/*exShowCheckBox*/ oColumn1 := oGrid:Columns():Add("Pos") oColumn1:FormatColumn := "1 pos ``" oColumn1:AllowSort := .F. oColumn1:Width := 48 oColumn1:AllowSizing := .F. oColumn1:Alignment := 1/*CenterAlignment*/ oColumn1:HeaderAlignment := 1/*CenterAlignment*/ oColumn2 := oGrid:Columns():Add("Image") oColumn2:DisplayFilterButton := .T. oColumn2:FilterList := 8480/*exShowExclude+exShowCheckBox+exSortItemsAsc*/ oColumn2:FilterType := 10/*exImage*/ oColumn2:DisplayExpandButton := .T. oColumn2:ExpandColumns := "1,2,3" oColumn2:Width := 128 oColumn2:HeaderImage := 1 oColumn3 := oGrid:Columns():Add("Images") oColumn3:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn3:Width := 196 oColumn3:HTMLCaption := "<img>1</img><img>2</img><img>3</img> Images" oGrid:Columns:Item("Pos"):Position := 3 oItems := oGrid:Items() hR := oItems:AddItem("Root") oItems:SetProperty("ItemDivider",hR,0) oItems:SetProperty("ItemDividerLine",hR,0/*EmptyLine*/) h := oItems:InsertItem(hR,,"Child A") oItems:SetProperty("CellImage",h,2,1) oItems:SetProperty("CellImages",h,3,"1,2,3") oItems:SetProperty("CellValue",h,3,"123") h := oItems:InsertItem(hR,,"Child B") oItems:SetProperty("CellState",h,0,1) oItems:SetProperty("CellImage",h,2,3) oItems:SetProperty("CellImages",h,3,"2,3,1") oItems:SetProperty("CellValue",h,3,"231") oItems:SetProperty("SelectItem",h,.T.) h := oItems:InsertItem(hR,,"Child C") oItems:SetProperty("CellImage",h,2,2) oItems:SetProperty("CellState",h,3,1) oItems:SetProperty("CellValue",h,3,"312") oItems:SetProperty("CellImages",h,3,"3,1,2") oItems:SetProperty("ExpandItem",hR,.T.) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1175 |
The user clicks the drop-down filter, select a value and the control's list filters for the selected item(s). Is there a way for when the user then goes to the next column to add another filter and the drop down arrow is clicked for the list of values they can filter by to be limited to what is being displayed in the list due to the first filter they set
PROCEDURE OnAddColumn(oGrid,Column) RETURN #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:AddColumn := {|Column| OnAddColumn(oGrid,Column)} /*Fired after a new column has been added.*/ oGrid:BeginUpdate() oGrid:ColumnAutoResize := .F. rs := CreateObject("ADOR.Recordset") rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/) oGrid:DataSource := rs oGrid:Columns:Item("ShipVia"):Position := 2 oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1174 |
Does the control display images from database (ADO)
|
1173 |
Does the control display images from database (DAO)
|
1172 |
Is it possible to set from code, a column sort without being inserted in the sortbar
#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. rs := CreateObject("ADOR.Recordset") rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/) oGrid:DataSource := rs oGrid:SortBarVisible := .T. oGrid:Layout := "singlesort=" + CHR(34) + "C1:1" + CHR(34) + "" oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1171 |
Is it possible to view all events the control fires
PROCEDURE OnEvent(oGrid,EventID) DevOut( Transform(oGrid:EventParam(-2),"") ) 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 oItems LOCAL h,hChild 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:Event := {|EventID| OnEvent(oGrid,EventID)} /*Notifies the application once the control fires an event.*/ oGrid:BeginUpdate() oGrid:LinesAtRoot := -1/*exLinesAtRoot*/ oColumn := oGrid:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oColumn:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn:FormatColumn := "value + (%CS0 = 1 ? `<r><fgcolor=808080>(checked)` : ``)" oColumn:Editor():EditType := 1/*EditType*/ oGrid:HeaderVisible := .T. oItems := oGrid:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:SetProperty("CellState",hChild,0,1) 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 |
1170 |
How can I find all occurences of the giving value, within a 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 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("Default") oColumn := oGrid:Columns():Add("Pos") oColumn:FormatColumn := "1 pos 'A-Z'" oColumn:Position := 0 oColumn:AllowSizing := .F. oColumn:Width := 32 oColumn:Enabled := .F. oColumn1 := oGrid:Columns():Add("Index") oColumn1:FormatColumn := "0 index ''" oColumn1:AllowSizing := .F. oColumn1:Width := 32 oColumn1:Enabled := .F. oItems := oGrid:Items() oItems:AddItem("A") oItems:AddItem("A") oItems:AddItem("A") DevOut( oItems:CellCaption(oItems:FindItem("A",0,0),1) ) DevOut( oItems:CellCaption(oItems:FindItem("A",0,1),1) ) DevOut( oItems:CellCaption(oItems:FindItem("A",0,2),1) ) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1169 |
How can I prevent expanding/collapsing the child items
PROCEDURE OnBeforeExpandItem(oGrid,Item,Cancel) Cancel := oGrid:Items():ItemParent(Item) RETURN #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:BeforeExpandItem := {|Item,Cancel| OnBeforeExpandItem(oGrid,Item,Cancel)} /*Fired before an item is about to be expanded (collapsed).*/ oGrid:BeginUpdate() oGrid:SingleSel := .F. oGrid:Columns():Add("Default") oGrid:LinesAtRoot := -1/*exLinesAtRoot*/ oItems := oGrid:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(oItems:InsertItem(h,,"Child 1.1"),,"Child") oItems:InsertItem(h,,"Child 1.2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(oItems:InsertItem(h,,"Child 2.1"),,"Child") oItems:InsertItem(h,,"Child 2.2") 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 |
1168 |
How can I display the EBN bigger or smaller (thumb)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGrid LOCAL oAppearance 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:Add(1,"c:\exontrol\images\normal.ebn") oAppearance:Add(10,"CP:1 0 3 0 -3") oAppearance:Add(17,"CP:1 3 0 -3 0") oGrid:SetProperty("Background",388/*exHSThumb*/,0xa000000) oGrid:SetProperty("Background",260/*exVSThumb*/,0x11000000) oGrid:ScrollBars := 3855/*exVScrollEmptySpace+exHScrollEmptySpace+exVScrollOnThumbRelease+exHScrollOnThumbRelease+exDisableBoth*/ oGrid:ScrollBySingleLine := .T. oGrid:Columns():Add("Def") oItems := oGrid:Items() oItems:AddItem(1) oItems:AddItem(2) oItems:AddItem(3) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1167 |
I am using GroupBy feature to create a tree, but the top rows are aligned with the children, not indented. What could be wrong
PROCEDURE OnAddGroupItem(oGrid,Item) /*AddBar(Item,"Progress", #12/2/2017#,#12/2/2017#)*/ /*DefineSummaryBars(Item,"", -3, "")*/ /*Chart.ItemBackColor(Item) = color*/ LOCAL oItems LOCAL color color := 14474460 oItems := oGrid:Items() oItems:SetProperty("ItemDivider",Item,-1) oItems:SetProperty("CellValue",Item,1,oItems:CellCaption(Item,oItems:GroupItem(Item))) oItems:SetProperty("ItemBold",Item,.T.) oItems:SetProperty("ItemBackColor",Item,color) RETURN PROCEDURE OnAddItem(oGrid,Item) /*AddBar(Item,"Task",#12/4/2017#,#12/10/2017#)*/ /*ItemBar(Item,"", 514) = ItemToIndex(Item)*/ LOCAL oItems oItems := oGrid:Items() RETURN #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 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:AddGroupItem := {|Item| OnAddGroupItem(oGrid,Item)} /*Occurs after a new Group Item has been inserted to Items collection.*/ oGrid:AddItem := {|Item| OnAddItem(oGrid,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oGrid:BeginUpdate() oColumns := oGrid:Columns() oColumns:Add("C1") oColumns:Add("C2") oGrid:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:SortBarVisible := .T. oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column." oGrid:AllowGroupBy := .T. oItems := oGrid:Items() h := oItems:AddItem("Item A") oItems:SetProperty("CellValue",h,1,"SubItem A.1") h := oItems:AddItem("Item A") oItems:SetProperty("CellValue",h,1,"SubItem A.1") h := oItems:AddItem("Item A") oItems:SetProperty("CellValue",h,1,"SubItem A.1") h := oItems:AddItem("Item A") oItems:SetProperty("CellValue",h,1,"SubItem A.1") h := oItems:AddItem("Item B") oItems:SetProperty("CellValue",h,1,"SubItem B.1") h := oItems:AddItem("Item B") oItems:SetProperty("CellValue",h,1,"SubItem B.1") oGrid:Columns:Item(0):SortOrder := 1/*SortAscending*/ oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1166 |
How can I display an item of picture type
|
1165 |
Dark mode
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGrid LOCAL back,fore 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() back := 65536 fore := 16777215 oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABXUIQAAYAQGKIcBiAKBQAGYBIJDEMgzDDAUBjKKocQTC4AIQjCK4JDKHYJRpHEZyCA8EhqGASRAFUQBYiWE4oSpLABQaK0ZwIGyRIrkGQgQgmPYDSDNU4zVIEEglBI0TDNczhNDENgtGYaJqHIYpZBcM40TKkEZoSIITZcRrOEBiRL1S0RBhGcRUHZlWzdN64LhuK47UrWdD/XhdVzXRbjfz1Oq+bxve48Br7A5yYThdr4LhOFQ3RjIL4xbIcUwGe6VZhjOLZXjmO49T69HTtOCYBEBA") oGrid:VisualAppearance():Add(2,"gBFLBCJwBAEHhEJAAEhABPMIQAAYAQGKIcBiAKBQAGaAoDDcMgwQwAAxjIKUEwsACEIrjKCYVgOHYYQjGMZwHCMIhiGwcAChEZYHgkMYmDAMUhSE78axHG6PY7kKZ4biaKIqQLLEhSfJ0YyBECBZpfebIbjmIZMSLEIxDKItJSpCIaRgqWS6ahGO4JUbUFLQHT9IR4daIYRgEEBA") oGrid:VisualAppearance():Add(3,"gBFLBCJwBAEHhEJAAEhABUUIQAAYAQGKIcBiAKBQAGaAoDDcMgwQwAAxjIKUEwsACEIrjKCYVgOHYYQjGMZwGAsEwjAoYAChEaILgkMw2DBIQwgJIMEr/G6RZxjeL5CjmG4nDhKMpybAcXxjBIYZJgOQpXb+PobTrNNLzfRFAxVAaWJikcZ4HpIAJNVLFdQ0XYMNSBISsBqrKiKcpeIIDWBZMbRZT1ZABCIZBpEW6LahENQwXrCN74DYkNTdKaxbbuaaXLhGCYBgIA==") oGrid:HeaderAppearance := 5/*Bump*/ oGrid:SetProperty("BackColor",back) oGrid:SetProperty("BackColorHeader",back) oGrid:SetProperty("BackColorLevelHeader",back) oGrid:SetProperty("BackColorSortBar",back) oGrid:SetProperty("BackColorSortBarCaption",back) oGrid:SetProperty("FilterBarBackColor",back) oGrid:SetProperty("FilterBarForeColor",fore) oGrid:SetProperty("ForeColor",fore) oGrid:SetProperty("ForeColorHeader",fore) oGrid:SetProperty("ForeColorSortBar",fore) oGrid:SetProperty("SelBackColor",fore) oGrid:SetProperty("SelForeColor",back) oGrid:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x1000000) oGrid:SetProperty("Background",32/*exCursorHoverColumn*/,-1) oGrid:SetProperty("Background",64/*exToolTipAppearance*/,0x3000000) oGrid:SetProperty("Background",65/*exToolTipBackColor*/,back) oGrid:SetProperty("Background",66/*exToolTipForeColor*/,fore) oGrid:SetProperty("Background",20/*exSelBackColorFilter*/,fore) oGrid:SetProperty("Background",21/*exSelForeColorFilter*/,back) oGrid:SetProperty("Background",26/*exBackColorFilter*/,back) oGrid:SetProperty("Background",27/*exForeColorFilter*/,fore) oGrid:SetProperty("Background",28/*exSortBarLinkColor*/,back) oGrid:SetProperty("Background",511/*exScrollSizeGrip*/,back) oGrid:SetProperty("Description",25/*exFilterBarExclude*/,"<bgcolor 0><fgcolor ffffff> Exclude </fgcolor></bgcolor>") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1164 |
I have changed the font, but the item's height remains the same. What I am doing wrong
#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:LoadXML("http://www.exontrol.net/testing.xml") oGrid:Font():Size := 22 oGrid:HeaderHeight := 42 oGrid:DefaultItemHeight := 36 oGrid:Items():SetProperty("ItemHeight",0,oGrid:DefaultItemHeight()) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1163 |
How can I specify the cell's outline, border or lines around, when the cell gets selected
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGrid LOCAL oAppearance 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:AttachTemplate("handle AddColumn(Column){Column{Def(48)=4;Def(49)=4;}}") oAppearance := oGrid:VisualAppearance() oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABPEGACAADACAxRDgMQBQKAAzQFAYbBuGCGAAGIYBTgmFgAQhFcZQSpEEg7BKMYwjOJgFgmEQxDANIBQSKoaQiGQYYLhEZAEiONoaDJCM4wHIMQxHCKTZRkGcfaRCGSfIzpGKpVgOTYiTbPcIyQKtBxDIydJTmeQQQhsFIJU7SdVUPDUJZlWbLAwWTAYazXCKRZBpeJqdo6Y5RUDKUqSdLUYyvEq7ZqnOIpw5vICpaCqOp6HqKFpiXSAFL1fLmAwvPKrJjoeqpWpyCaRZQAGg4dbEdTNNCIbatQANKrCSpgZ7sMB6Di2L4TPS2awoWgRYyTFZMbBAeQ7LC1c45Fqrd4zS4dSxKCahcLxFiaNpYZYnjUap1jGPJlkuAgAkidB3nceZsCQEQJCgGhMGcQ4pkiSxEAAOYpiQIhvkYNA2gSCg5n+LIoGILowFyXQoAYAoAmASAWAaAZgggJgKF2T54DYDoDmECBGBKBJgGgTgWgW" +; "YRoFYGIGmGOBqByB5hCgegggiYJYgoJIICIaIeByChixULILGGGAWDCCgjCiTgrg0YxojoC4OmOSJ2D6D5kAgJLFgABAEICA=") oAppearance:Add(2,"CP:1 -4 0 0 0") oGrid:SetProperty("SelBackColor",0x2000000) oGrid:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oGrid:FullRowSelect := 0/*exColumnSel*/ oGrid:ShowFocusRect := .F. oGrid:DefaultItemHeight := 24 oGrid:HeaderHeight := 24 oGrid:DrawGridLines := 2/*exVLines*/ oGrid:Columns():Add("C1") oGrid:Columns():Add("C2") oItems := oGrid:Items() oItems:SetProperty("CellValue",oItems:AddItem("Cell 1"),1,"Cell 2") oItems:SetProperty("CellValue",oItems:AddItem("Cell 3"),1,"Cell 4") oGrid:Items():SelectPos := 1 oGrid:SelectColumnIndex := 1 oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1162 |
How can I specify the cell's outline, border or lines around, when the item gets selected
#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:AttachTemplate("handle AddColumn(Column){Column{Def(48)=4;Def(49)=4;}}") oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABPEGACAADACAxRDgMQBQKAAzQFAYbBuGCGAAGIYBTgmFgAQhFcZQSpEEg7BKMYwjOJgFgmEQxDANIBQSKoaQiGQYYLhEZAEiONoaDJCM4wHIMQxHCKTZRkGcfaRCGSfIzpGKpVgOTYiTbPcIyQKtBxDIydJTmeQQQhsFIJU7SdVUPDUJZlWbLAwWTAYazXCKRZBpeJqdo6Y5RUDKUqSdLUYyvEq7ZqnOIpw5vICpaCqOp6HqKFpiXSAFL1fLmAwvPKrJjoeqpWpyCaRZQAGg4dbEdTNNCIbatQANKrCSpgZ7sMB6Di2L4TPS2awoWgRYyTFZMbBAeQ7LC1c45Fqrd4zS4dSxKCahcLxFiaNpYZYnjUap1jGPJlkuAgAkidB3nceZsCQEQJCgGhMGcQ4pkiSxEAAOYpiQIhvkYNA2gSCg5n+LIoGILowFyXQoAYAoAmASAWAaAZgggJgKF2T54DYDoDmECBGBKBJgGgTgWgW" +; "YRoFYGIGmGOBqByB5hCgegggiYJYgoJIICIaIeByChixULILGGGAWDCCgjCiTgrg0YxojoC4OmOSJ2D6D5kAgJLFgABAEICA=") oGrid:SetProperty("SelBackColor",0x1000000) oGrid:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oGrid:ShowFocusRect := .F. oGrid:DefaultItemHeight := 24 oGrid:HeaderHeight := 24 oGrid:DrawGridLines := 2/*exVLines*/ oGrid:Columns():Add("C1") oGrid:Columns():Add("C2") oItems := oGrid:Items() oItems:SetProperty("CellValue",oItems:AddItem("Cell 1"),1,"Cell 2") oItems:SetProperty("CellValue",oItems:AddItem("Cell 3"),1,"Cell 4") oItems:SelectPos := 1 oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1161 |
How can I specify the cell's outline, border or lines around
#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:AttachTemplate("handle AddColumn(Column){Column{Def(48)=4;Def(49)=4;}}") oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABPEGACAADACAxRDgMQBQKAAzQFAYbBuGCGAAGIYBTgmFgAQhFcZQSpEEg7BKMYwjOJgFgmEQxDANIBQSKoaQiGQYYLhEZAEiONoaDJCM4wHIMQxHCKTZRkGcfaRCGSfIzpGKpVgOTYiTbPcIyQKtBxDIydJTmeQQQhsFIJU7SdVUPDUJZlWbLAwWTAYazXCKRZBpeJqdo6Y5RUDKUqSdLUYyvEq7ZqnOIpw5vICpaCqOp6HqKFpiXSAFL1fLmAwvPKrJjoeqpWpyCaRZQAGg4dbEdTNNCIbatQANKrCSpgZ7sMB6Di2L4TPS2awoWgRYyTFZMbBAeQ7LC1c45Fqrd4zS4dSxKCahcLxFiaNpYZYnjUap1jGPJlkuAgAkidB3nceZsCQEQJCgGhMGcQ4pkiSxEAAOYpiQIhvkYNA2gSCg5n+LIoGILowFyXQoAYAoAmASAWAaAZgggJgKF2T54DYDoDmECBGBKBJgGgTgWgW" +; "YRoFYGIGmGOBqByB5hCgegggiYJYgoJIICIaIeByChixULILGGGAWDCCgjCiTgrg0YxojoC4OmOSJ2D6D5kAgJLFgABAEICA=") oGrid:SelBackMode := 1/*exTransparent*/ oGrid:ShowFocusRect := .F. oGrid:DefaultItemHeight := 24 oGrid:HeaderHeight := 24 oGrid:DrawGridLines := 2/*exVLines*/ oGrid:Columns():Add("C1") oGrid:Columns():Add("C2") oItems := oGrid:Items() oItems:SetProperty("CellValue",oItems:AddItem("Cell 1"),1,"Cell 2") h := oItems:AddItem("Cell 2") oItems:SetProperty("CellValue",h,1,"Cell 3") oItems:SetProperty("CellBackColor",h,1,0x1000000) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1160 |
Is it possible to highligth the match while a filter is applied
PROCEDURE OnAddColumn(oGrid,Column) /*Column.Def(17) = 1*/ RETURN PROCEDURE OnFilterChange(oGrid) LOCAL format format := oGrid:FormatABC("`value replace '` + value + `' with '<bgcolor 000000><fgcolor FFFFFF>` + value + `</fgcolor></bgcolor>'`",oGrid:FilterBarPromptPattern()) oGrid:Columns:Item(0):FormatColumn := Transform(format,"") oGrid:Columns:Item(1):FormatColumn := Transform(format,"") 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:AddColumn := {|Column| OnAddColumn(oGrid,Column)} /*Fired after a new column has been added.*/ oGrid:FilterChange := {|| OnFilterChange(oGrid)} /*Occurs when filter was changed.*/ oGrid:BeginUpdate() oGrid:DrawGridLines := 2/*exVLines*/ oGrid:HeaderAppearance := 4/*Etched*/ oGrid:Columns():Add("Col 1") oGrid:Columns():Add("Col 2") oItems := oGrid:Items() oItems:SetProperty("CellValue",oItems:AddItem("219 Smith"),1,"Ignacio 1234") oItems:SetProperty("CellValue",oItems:AddItem("1666 County Road 309A"),1,"897 Manassa") oItems:SetProperty("CellValue",oItems:AddItem("38 Lone Pine"),1,"Durango 11") oItems:SetProperty("CellValue",oItems:AddItem("612 Jachim Street"),1,"Lamar 222") oGrid:FilterBarPromptPattern := "1" oGrid:FilterBarPromptVisible := 2067/*exFilterBarCompact+exFilterBarSingleLine+exFilterBarVisible+exFilterBarPromptVisible*/ oGrid:FilterBarPromptType := 257/*exFilterPromptCaseSensitive+exFilterPromptContainsAll*/ oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1159 |
How can I replace the cell's context menu ( while edit mode is running )
PROCEDURE OnRClick(oGrid) LOCAL oExContextMenu DevOut( "Edit Mode: " ) DevOut( Transform(oGrid:Editing(),"") ) oExContextMenu := CreateObject("Exontrol.ContextMenu") oExContextMenu:Items():ToString := "Check[chk],[sep],Item 1,Item 2,Item 3,Popup(A,B,C)" DevOut( Transform(oExContextMenu:Select(),"") ) 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:RClick := {|| OnRClick(oGrid)} /*Fired when right mouse button is clicked*/ oGrid:BeginUpdate() oGrid:HeaderAppearance := 1/*Flat*/ oEditor := oGrid:Columns():Add("Column"):Editor() oEditor:EditType := 1/*EditType*/ oEditor:SetProperty("Option",202/*exEditAllowContextMenu*/,.F.) oItems := oGrid:Items() oItems:AddItem("Item 1") oItems:AddItem("Item 2") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1158 |
Is it possible to highlight the column's header once a filter is applied (sample 2)
#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 oColumns 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() o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oYj0MIRHeM4/m6cJ8B+fpBHQJ5SGKPYYH8OYMk+P5Bn4fxaAYZAvEIX4RgUWBGgCCAmAqApgkgNgOgMEYlGASoEkQeBWBa" +; "BZhggZgagaYRoEwShWA6NZZAMQBAICA==") oGrid:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x1000000) oGrid:SetProperty("Background",41/*exHeaderFilterBarActive*/,0x2000000) oGrid:SetProperty("Background",32/*exCursorHoverColumn*/,-1) oGrid:HeaderHeight := 28 oGrid:SetProperty("BackColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oGrid:DrawGridLines := -2/*exRowLines*/ oGrid:HeaderVisible := .T. oColumns := oGrid:Columns() oColumns:Add("C1"):DisplayFilterButton := .T. oColumn := oColumns:Add("C2") oColumn:DisplayFilterButton := .T. oColumn:Filter := "Item 2" oColumn:FilterType := 240/*exFilter*/ oColumns:Add("C3"):DisplayFilterButton := .T. oItems := oGrid:Items() h := oItems:AddItem("Item 1") oItems:SetProperty("CellValue",h,1,"Item 2") oItems:SetProperty("CellValue",h,2,"Item 3") h := oItems:AddItem("Item 4") oItems:SetProperty("CellValue",h,1,"Item 5") oItems:SetProperty("CellValue",h,2,"Item 6") oGrid:ApplyFilter() oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1157 |
How can I make the expand/collapse glyphs DPI aware
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGrid LOCAL oAppearance LOCAL oItems LOCAL h,size 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} ) size := 2 oGrid:BeginUpdate() oAppearance := oGrid:VisualAppearance() oAppearance:Add(3,"gBFLBCJwBAEHhEJAAEhEGAUHQAAYAQGKIcBiAKBQAGaAoDDYOA4QwAAxDAKcEwsACEIrjKCRShyCYZRhGcTSBCIZBqEqSZLiEZRQiiCYsS5GQBRfIUEghGyNZjgNzQcCQAI8T5IUgARBJIDSMY6DpOIxYHgmC4DEITNLxOK0EhRHCBZrgOCAYhqEY1Ro+dhPFYjVTMdK0LRtKy7Mq2aJmOpZDxWE7dZKpO5fbxXS67cr2fp/YBed4rfa7KTlOBKcRQRBEFQPDqPZBkORZHh2FoLRJKbgtHJmHYNQWhVyYBbNCyTI6lahpeuHBx1QaWWxjbCMEr6bpoWLbFi3Ha1UzrPa8b5vSw7Gr+HzYQTHGPXGqaYJdZrnea6B7+U5XUJrnSOZciYHwhAeR5HDK+JVGqKRRmScx5HyfRei+H5bmmcp4Fi8o/CGGJKGQKZUGoFQigUPIiCeSZXnyHB6l0SAJn8JxfkIeZ5CgXxjCCAhyB8QgIlAM4MlKAIcCaIBIGY" +; "GoGGEYhqBMMxgnICgRDUDQjESGwmAkWBuCqBoiHIVgkDQYgYESWg2E0YhohcJQigITg3CQSRyEyEYGGOWJwhQJD4FiFIMk0aJFGsIBkkOBJeDc+AchYJwJgIWhSgYZQpFIVoVGOGQ4l2EwIBWMhgDmDhThCEwkAiaJchKDhjhgZhsCUY4iFCEoZkiaYQmSGAWhWQhgDuDpTjCDQiEgchAg0IpJBoDoFiEKBqCaCAimgIguH8IZnkPUhcBcJg+hGJZnloYJsiaKZKGa24YnWSR0CkKhCA2CxlCqColhAYpqEKER0DqVZ0A0ASAgA==") oAppearance:Add(4,"gBFLBCJwBAEHhEJAAEhABAQCg6AADACAxRDgMQBQKAAzQFAYbBwHCGAAGIYBTgmFgAQhFcZQSKUOQTDKNYykCIRSDUJYkSZEIyjBI8ExXFqNACjeQYJBCNYbTJAbqhYIgAR3HqQZABCCSQKkYx0HScRiwPBMFwGIQmaaicZoJCiN4DTZAcIBRDUIxpDR9bBeKw3KqVaZnWhaNpWXZlTzKdSxXisF67RZSdi/XgvF5XXblez9P69LwXe5mUrGbyVYghCCIKgeG4dR7IMhyLDcKQXCCVW7aGSsOwbAqAXpdGAXTQdDyLJKnaZqOi6BjjA4rNbHGIYJb1XTRMa1LJuG5LJrOeZ3Xre4BLfh1VoFRpjWIYNY1QS7TLOczzfRdDxTiGVpkjCeJoD4Ng1hSRxiisVRKg8D4PkWZJznmPQ+F8Xx5guWpjHGWYMiYQodEaIRSCgU5KCSeh3naHB/iAAh9n8fwfgIeZ1CgXwjCCAhxl8AgIlAM4MlKAIcCaD54FY" +; "FoFmGCBmBaBIJigPJNgKSAoDSVC+BIbIYCUYYoiYKoJgkWIMlGCAglMaJZDWCYiFyFIJkkOJYhEJc7G4PYPCOaJshQJBjgiVIUgyDRokEaggGSQ4El4N1CBiFgnAmAhaFKFZlFkShUhWJRYmITg3GSQgFGuGBOGOFJkCSSQCDoNgkiOCY0hUJJmmmQhvhqZtYmUOQmBWIRvhgTpjjSbAjEiEgchBZgyEaBIhigWgegqIhIjoDILiACB5nTL5WnWRYOiSKYJnqGQ7CmOh2hqJ5OkYORxFyShKhSAxihkOomioY5YiqFIkFyTo1HkAxAEAgIA==") oAppearance:Add(1,oGrid:FormatABC("`CP:3 -` + int(value*dpi) + ` -` + int(value*dpi) + ` ` + int(value*dpi) + ` ` + int(value*dpi)",size)) oAppearance:Add(2,oGrid:FormatABC("`CP:4 -` + int(value*dpi) + ` -` + int(value*dpi) + ` ` + int(value*dpi) + ` ` + int(value*dpi)",size)) oGrid:LinesAtRoot := 1/*exGroupLinesAtRoot*/ oGrid:HasButtons := 4/*exCustom*/ oGrid:SetProperty("HasButtonsCustom",.F.,16777216) oGrid:SetProperty("HasButtonsCustom",.T.,33554432) oGrid:Columns():Add("Column") 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") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1156 |
Is it possible to highlight the column's header once a filter is applied (sample 1)
#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 oColumns 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() oAppearance := oGrid:VisualAppearance() oAppearance:Add(2,"gBFLBCJwBAEHhEJAAEhABX8GACAADACAxSDEMQBQKAAzQFAYbhgHCGAAGQaBUgmFgAQhFcZQSKUOQTDKNYykCIRSDUJYkSZEIyjBI8ExXFqNACkGKwYgmNYiTLAcgANJ0WBaGIZJ4gOT5fDKMoEDRRYADFCscwxJybQAqGQKKb+VgAVY/cTyBIAEQSKA0TDOQ5TSKWB4JPZQRBEbZMNBtBIUJquKaqShdQJCU5FdY3Xblez9P7AMBwLFEC4NQ8YNYuPhjR4dRTIMhvVAsUArFh8Zg9GZZFjmDIDT4ydBLTQwcyVIKnP5qOa6XbmPoCQDYKxZHYxPzVDa3axuL76dqCAT7XrXNy1TbNRrzQKfcJqfCbdw2YaDZLOOT3fjuI4hhKaRzFAHJ+jYQ4xHuY4gHuGIXGeExqC8Tp6C+PoEm+G5ImycRgh0XwvDGa5rgOeoejyXwnFeQp2mkf5ClgBB9gCWIYAwfYAEKV58mkdwOggNArgOXY2EWLoDkKOA0mg" +; "bhOGgZApgaSBIHWSYHSmbApgYThmESZYJkIeIkgeCpfliLIHgpMIcmUYYYmODAlg2SI4mWfRfGOEguDcCRjFYAJihCQhJBSDoRmONgKEcI4kFCEJhhOVYTmYnAlEAQhWBMJYJGYWoWmWSR2F6F5lnkWAQhUAgpEieRWEuSYkjWGpmkmNhuhuZwJkYcocmaaYkjyEhngnUA6lEFAlAEgI=") oAppearance:Add(1,"CP:2 -8 -4 2 4") oGrid:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x1fefefe) oGrid:SetProperty("Background",41/*exHeaderFilterBarActive*/,0x1010101) oGrid:SetProperty("Background",32/*exCursorHoverColumn*/,-1) oGrid:HeaderHeight := 28 oGrid:SetProperty("BackColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oGrid:DrawGridLines := -2/*exRowLines*/ oGrid:HeaderVisible := .T. oColumns := oGrid:Columns() oColumns:Add("C1"):DisplayFilterButton := .T. oColumn := oColumns:Add("C2") oColumn:DisplayFilterButton := .T. oColumn:Filter := "Item 2" oColumn:FilterType := 240/*exFilter*/ oColumns:Add("C3"):DisplayFilterButton := .T. oItems := oGrid:Items() h := oItems:AddItem("Item 1") oItems:SetProperty("CellValue",h,1,"Item 2") oItems:SetProperty("CellValue",h,2,"Item 3") h := oItems:AddItem("Item 4") oItems:SetProperty("CellValue",h,1,"Item 5") oItems:SetProperty("CellValue",h,2,"Item 6") oGrid:ApplyFilter() oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1155 |
How do I update itemcount and matchitemcount of the FilterBarCaption after I added the item using the AddItem method
PROCEDURE OnClick(oGrid) oGrid:Items():AddItem("new") 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 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() oColumn := oGrid:Columns():Add("Item") oColumn:DisplayFilterButton := .T. oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/ oColumn1 := oGrid:Columns():Add("Pos") oColumn1:AllowSizing := .F. oColumn1:AllowSort := .F. oColumn1:Width := 32 oColumn1:FormatColumn := "1 apos ``" oColumn1:Position := 0 oItems := oGrid:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oGrid:FilterBarCaption := "`<r>` + value + `</b><fgcolor=808080>` + ( matchitemcount < 0 ? ( ( len(value) ? `<br>` : `` ) + `<r>` + abs(matchitemcount + 1) + ` result(s)` ) : (`<fgcolor=808080>`+ itemcount + ` item(s)`) )" oGrid:FilterBarPromptVisible := 3591/*exFilterBarCompact+exFilterBarShowCloseOnRight+exFilterBarShowCloseIfRequired+exFilterBarCaptionVisible+exFilterBarVisible+exFilterBarPromptVisible*/ oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1154 |
I can't get values in the column properly centered. What can be the problem
#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:TreeColumnIndex := -1 oGrid:DrawGridLines := -2/*exRowLines*/ oColumn := oGrid:Columns():Add("Default") oColumn:Alignment := 1/*CenterAlignment*/ oColumn:FormatColumn := "ltrim(rtrim(value))" oGrid:Items():AddItem("item 1 ") oGrid:Items():AddItem(" item 2") oGrid:Items():AddItem(" item 3 ") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1153 |
The Edit method does not work while ReadOnly property is exLocked and the first column is hidden. Is there any fix
PROCEDURE OnDblClick(oGrid,Shift,X,Y) LOCAL var_ItemFromPoint var_ItemFromPoint := oGrid:ItemFromPoint(-1,-1,c,hit) oGrid:FocusColumnIndex := c oGrid:Edit() 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 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:DblClick := {|Shift,X,Y| OnDblClick(oGrid,Shift,X,Y)} /*Occurs when the user dblclk the left mouse button over an object.*/ oGrid:BeginUpdate() oGrid:HeaderAppearance := 4/*Etched*/ oGrid:AutoEdit := .F. oGrid:ReadOnly := 1/*exLocked*/ oGrid:AutoSearch := .T. oGrid:Columns():Add(""):Visible := .F. oColumn := oGrid:Columns():Add("Contains") oColumn:AutoSearch := 1/*exContains*/ oColumn:Editor():EditType := 1/*EditType*/ oItems := oGrid:Items() oItems:SetProperty("CellValue",oItems:AddItem(),1,"Tom Hanks") oItems:SetProperty("CellValue",oItems:AddItem(),1,"Leonardo DiCaprio") oItems:SetProperty("CellValue",oItems:AddItem(),1,"Will Smith") oItems:SetProperty("CellValue",oItems:AddItem(),1,"Tom Cruise") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1152 |
How can I enable the Undo/Redo feature
#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 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:AllowUndoRedo := .T. oGrid:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:HeaderAppearance := 4/*Etched*/ oColumn := oGrid:Columns():Add("P1") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oColumn1 := oGrid:Columns():Add("P2") oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn1:PartialCheck := .T. oItems := oGrid:Items() h := oItems:AddItem("Root") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) oItems:AddItem("Press CTRL + Z for Undo, and CTRL + Y for Redo") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1151 |
The incremental search feature is no working for columns with editor assigned. What can be done
PROCEDURE OnDblClick(oGrid,Shift,X,Y) oGrid:Edit() 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 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:DblClick := {|Shift,X,Y| OnDblClick(oGrid,Shift,X,Y)} /*Occurs when the user dblclk the left mouse button over an object.*/ oGrid:BeginUpdate() oGrid:HeaderAppearance := 4/*Etched*/ oGrid:AutoEdit := .F. oGrid:AutoSearch := .T. oColumn := oGrid:Columns():Add("Contains") oColumn:AutoSearch := 1/*exContains*/ oColumn:Editor():EditType := 1/*EditType*/ oItems := oGrid:Items() oItems:AddItem("Tom Hanks") oItems:AddItem("Leonardo DiCaprio") oItems:AddItem("Will Smith") oItems:AddItem("Tom Cruise") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1150 |
Each item is representated by a key as string. Is it possible to have a drop down editor to display more information when using the item's key
#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:BeginUpdate() oGrid:HeaderAppearance := 4/*Etched*/ oEditor := oGrid:Columns():Add("Multiple-Columns Tree DropDownListType"):Editor() oEditor:EditType := 3/*DropDownListType*/ oEditor:AddItem(0,"KR|Korea, Republic of") oEditor:AddItem(1,"MO|Macao") oEditor:AddItem(2,"SA|Saudi Arabia") oEditor:AddItem(3,"EG|Egypt") oEditor:AddItem(4,"GB|United Kingdom") oEditor:AddItem(5,"GT|Guatemala") oEditor:AddItem(6,"SR|Suriname") oEditor:AddItem(7,"BM|Bermuda") oItems := oGrid:Items() oItems:AddItem("EG") oItems:AddItem("GB") oItems:AddItem("BM") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1149 |
My table includes codes/keys for items, can I display a drop down editor to include more information
#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:BeginUpdate() oGrid:HeaderAppearance := 4/*Etched*/ oEditor := oGrid:Columns():Add("Multiple-Columns DropDownListType"):Editor() oEditor:EditType := 3/*DropDownListType*/ oEditor:DropDownAutoWidth := 0/*exDropDownEditorWidth*/ oEditor:SetProperty("Option",57/*exDropDownColumnCaption*/,"City¦Coordinates¦State") oEditor:AddItem(0,"JV3|Jollyville¦3026N 09746W¦Texas") oEditor:AddItem(1,"TMO|Altamont¦4021N 11017W¦Utah") oEditor:AddItem(2,"IIM|Williamston¦4241N 08417W¦Michigan") oEditor:AddItem(3,"IWN|Merrittstown¦3958N 07952W¦Pennsylvania") oEditor:AddItem(4,"HOU|Houston¦2945N 09521W¦Texas") oEditor:AddItem(5,"GSF|Gales Ferry¦4125N 07205W¦Connecticut") oItems := oGrid:Items() oItems:AddItem("HOU") oItems:AddItem("IIM") oItems:AddItem("TMO") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1148 |
How can I display and select from a multiple-columns tree editor
#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:BeginUpdate() oGrid:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=") oGrid:HeaderAppearance := 4/*Etched*/ oEditor := oGrid:Columns():Add("Multiple-Columns Tree DropDownListType"):Editor() oEditor:EditType := 3/*DropDownListType*/ oEditor:DropDownAutoWidth := 0/*exDropDownEditorWidth*/ oEditor:SetProperty("Option",57/*exDropDownColumnCaption*/,"Name¦Title¦City¦Phone") oEditor:SetProperty("Option",58/*exDropDownColumnWidth*/,"224¦¦¦96") oEditor:AddItem(1,"Nancy Davolio¦Sales Representative¦Seattle¦(206) 555-9857",1) oEditor:AddItem(2,"Andrew Fuller¦<b>Vice President</b>, Sales¦Tacoma¦(206) 555-9482",2) oEditor:InsertItem(3,"Janet Leverling¦Sales Representative¦Kirkland¦(206) 555-3412",3,2) oEditor:InsertItem(4,"Peacock Margaret¦Sales Representative¦Redmond¦(206) 555-8122",3,2) oEditor:InsertItem(5,"Steven Buchanan¦Sales Manager¦London¦(71) 555-4848",2,2) oEditor:InsertItem(6,"Michael Suyama¦Sales Representative¦London¦(71) 555-7773",1,5) oEditor:InsertItem(7,"Robert King¦Sales Representative¦Kirkland¦(71) 555-5598",2,2) oEditor:InsertItem(8,"Laura Callahan¦Inside Sales Coordinator¦Seattle¦(206) 555-1189",3,2) oEditor:InsertItem(9,"Anne Dodsworth¦Sales Representative¦London¦(71) 555-4444",2,5) oEditor:ExpandAll() oItems := oGrid:Items() oItems:AddItem(1) oItems:AddItem(2) oItems:AddItem(4) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1147 |
Does you control support multiple-columns for a drop down editor
#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:BeginUpdate() oGrid:HeaderAppearance := 4/*Etched*/ oEditor := oGrid:Columns():Add("Multiple-Columns DropDownListType"):Editor() oEditor:EditType := 3/*DropDownListType*/ oEditor:DropDownAutoWidth := 0/*exDropDownEditorWidth*/ oEditor:AddItem(0,"Jollyville¦JV3¦3026N 09746W¦TX") oEditor:AddItem(1,"Altamont¦TMO¦4021N 11017W¦UT") oEditor:AddItem(2,"Williamston¦IIM¦4241N 08417W¦MI") oEditor:AddItem(3,"Merrittstown¦IWN¦3958N 07952W¦PA") oEditor:AddItem(4,"Houston¦HOU¦2945N 09521W¦TX") oEditor:AddItem(5,"Gales Ferry¦GSF¦4125N 07205W¦CT") oItems := oGrid:Items() oItems:InsertItem(0,"",1) oItems:InsertItem(0,"",2) oItems:InsertItem(0,"",4) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1146 |
Is it possible to show the filterbar on top of the rows
#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 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 := 8192/*exFilterBarTop*/ oGrid:HeaderHeight := 24 oGrid:FilterBarHeight := oGrid:HeaderHeight() oGrid:HeaderAppearance := 1/*Flat*/ oGrid:DrawGridLines := -1/*exAllLines*/ oGrid:GridLineStyle := 512/*exGridLinesGeometric*/ oColumn := oGrid:Columns():Add("Column") oColumn:DisplayFilterButton := .T. oColumn:FilterType := 3/*exPattern*/ oColumn:Filter := "B*" oColumn1 := oGrid:Columns():Add("Index") oColumn1:FormatColumn := "1 index ``" oColumn1:Position := 0 oColumn1:Width := 48 oColumn1:AllowSizing := .F. oColumn1:SortType := 1/*SortNumeric*/ oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oItems := oGrid:Items() oItems:AddItem("A.1") oItems:AddItem("A.2") oItems:AddItem("B.1") oItems:AddItem("B.2") oItems:AddItem("B.3") oItems:AddItem("C") oGrid:ApplyFilter() oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1145 |
DragDrop (with visual effect)
PROCEDURE OnOLEDragDrop(oGrid,Data,Effect,Button,Shift,X,Y) /*SelectItem(InsertItem(i,, Data.GetData(1))) = True*/ LOCAL oItems LOCAL i i := oGrid:ItemFromPoint(-1,-1,c,hit) oItems := oGrid:Items() oItems:SetProperty("ExpandItem",i,.T.) RETURN PROCEDURE OnOLEStartDrag(oGrid,Data,AllowedEffects) /*Data.SetData(Me.Items.CellCaption(FocusItem, 0), 1)*/ AllowedEffects := 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 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:OLEDragDrop := {|Data,Effect,Button,Shift,X,Y| OnOLEDragDrop(oGrid,Data,Effect,Button,Shift,X,Y)} /*Occurs when a source component is dropped onto a target component when the source component determines that a drop can occur.*/ oGrid:OLEStartDrag := {|Data,AllowedEffects| OnOLEStartDrag(oGrid,Data,AllowedEffects)} /*Occurs when the OLEDrag method is called.*/ oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABPUIQAAYAQGKIcBiAKBQAGaAoDgYN4MAANAwjJBMKgBBCLIxhEYobgmGIaRjEEQDCKYcxHCaIBiGcaIfDEBIeSBHcgRbAcOQHGSZZBhGRJGjuKIbSrLICzBDUcRnGwAKQoaaaEomHwyAZOYwDAIoWhpKKCKjqWJKNb+XgAAJTES0RRVRTNAZ1YghGAQgIA==") oGrid:SetProperty("Background",96/*exListOLEDropPosition*/,0x1000000) oGrid:SetProperty("Background",33/*exDragDropBefore*/,AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oGrid:SetProperty("Background",34/*exDragDropAfter*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oGrid:OLEDropMode := 1/*exOLEDropManual*/ oGrid:AutoDrag := 196608/*exAutoDragPositionAnyOnRight*/ oGrid:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:Indent := 16 oGrid:SelBackMode := 1/*exTransparent*/ oGrid:Columns():Add("Default") oItems := oGrid:Items() h := oItems:AddItem("Root") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) DevOut( "You can:" ) DevOut( "A) left-click to drag and drop items between controls (open a new exhelper and run the same sample)" ) DevOut( "B) right-click to re-arrange the item position inside the same control" ) DevOut( "This sample shows how you can insert the data being dropped as a child of the item being hovered." ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1144 |
DragDrop (with no visual effect, hide item while drag and drop)
PROCEDURE OnOLEDragDrop(oGrid,Data,Effect,Button,Shift,X,Y) /*SelectItem(InsertItem(i,, Data.GetData(1))) = True*/ LOCAL oItems LOCAL i i := oGrid:ItemFromPoint(-1,-1,c,hit) oItems := oGrid:Items() oItems:SetProperty("ExpandItem",i,.T.) RETURN PROCEDURE OnOLEStartDrag(oGrid,Data,AllowedEffects) /*Data.SetData(Me.Items.CellCaption(FocusItem, 0), 1)*/ AllowedEffects := 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 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:OLEDragDrop := {|Data,Effect,Button,Shift,X,Y| OnOLEDragDrop(oGrid,Data,Effect,Button,Shift,X,Y)} /*Occurs when a source component is dropped onto a target component when the source component determines that a drop can occur.*/ oGrid:OLEStartDrag := {|Data,AllowedEffects| OnOLEStartDrag(oGrid,Data,AllowedEffects)} /*Occurs when the OLEDrag method is called.*/ oGrid:SetProperty("Background",33/*exDragDropBefore*/,AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oGrid:SetProperty("Background",34/*exDragDropAfter*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oGrid:OLEDropMode := 1/*exOLEDropManual*/ oGrid:AutoDrag := 196608/*exAutoDragPositionAnyOnRight*/ oGrid:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:Indent := 16 oGrid:SelBackMode := 1/*exTransparent*/ oGrid:Columns():Add("Default") oItems := oGrid:Items() h := oItems:AddItem("Root") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) DevOut( "You can:" ) DevOut( "A) left-click to drag and drop items between controls (open a new exhelper and run the same sample)" ) DevOut( "B) right-click to re-arrange the item position inside the same control" ) DevOut( "This sample shows how you can insert the data being dropped as a child of the item being hovered." ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1143 |
DragDrop
PROCEDURE OnOLEDragDrop(oGrid,Data,Effect,Button,Shift,X,Y) /*SelectItem(InsertItem(i,, Data.GetData(1))) = True*/ LOCAL oItems LOCAL i i := oGrid:ItemFromPoint(-1,-1,c,hit) oItems := oGrid:Items() oItems:SetProperty("ExpandItem",i,.T.) RETURN PROCEDURE OnOLEStartDrag(oGrid,Data,AllowedEffects) /*Data.SetData(Me.Items.CellCaption(FocusItem, 0), 1)*/ AllowedEffects := 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 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:OLEDragDrop := {|Data,Effect,Button,Shift,X,Y| OnOLEDragDrop(oGrid,Data,Effect,Button,Shift,X,Y)} /*Occurs when a source component is dropped onto a target component when the source component determines that a drop can occur.*/ oGrid:OLEStartDrag := {|Data,AllowedEffects| OnOLEStartDrag(oGrid,Data,AllowedEffects)} /*Occurs when the OLEDrag method is called.*/ oGrid:OLEDropMode := 1/*exOLEDropManual*/ oGrid:AutoDrag := 196608/*exAutoDragPositionAnyOnRight*/ oGrid:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:Indent := 16 oGrid:SelBackMode := 1/*exTransparent*/ oGrid:Columns():Add("Default") oItems := oGrid:Items() h := oItems:AddItem("Root") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) DevOut( "You can:" ) DevOut( "A) left-click to drag and drop items between controls (open a new exhelper and run the same sample)" ) DevOut( "B) right-click to re-arrange the item position inside the same control" ) DevOut( "This sample shows how you can insert the data being dropped as a child of the item being hovered." ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1142 |
Is there anyway to stop the header changing colour when the mouse hovers/moves across the column header (non-clickable)
#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 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*/ oColumns := oGrid:Columns() oColumns:Add("Item") oColumn := oColumns:Add("Pos") oColumn:Position := 0 oColumn:Width := 32 oColumn:AllowSizing := .F. oColumn:FormatColumn := "1 index ``" oColumn:AllowSort := .F. oColumn:AllowDragging := .F. oItems := oGrid:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1141 |
Is there anyway to stop the header changing colour when the mouse hovers/moves across the column header
#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 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:SetProperty("Background",32/*exCursorHoverColumn*/,-1) oColumns := oGrid:Columns() oColumns:Add("Item") oColumn := oColumns:Add("Pos") oColumn:Position := 0 oColumn:Width := 32 oColumn:AllowSizing := .F. oColumn:FormatColumn := "1 index ``" oColumn:AllowSort := .F. oColumn:AllowDragging := .F. oItems := oGrid:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1140 |
Is it possible to exclude the parent/child items when do the filtering, so to include only items that match the filter without any indentation
PROCEDURE OnFilterChange(oGrid) oGrid:Indent := oGrid:FormatABC("value > 0 ? 18 : 0",:Items:MatchItemCount()) 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 LOCAL oColumns LOCAL oItems LOCAL h,h2 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:FilterChange := {|| OnFilterChange(oGrid)} /*Occurs when filter was changed.*/ oGrid:BeginUpdate() oGrid:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:Indent := 18 oGrid:FilterInclude := 4/*exMatchingItemsOnly*/ oGrid:DrawGridLines := 2/*exVLines*/ oGrid:HeaderAppearance := 1/*Flat*/ oColumns := oGrid:Columns() oColumn := oColumns:Add("Column") oColumn:DisplayFilterButton := .T. oColumn:FilterType := 240/*exFilter*/ oColumn:FilterList := 256/*exShowCheckBox*/ oColumn:Filter := "C1" oColumn1 := oColumns:Add("Pos") oColumn1:FormatColumn := "1 rindex ``" oColumn1:Position := 0 oColumn1:AllowSizing := .F. oColumn1:AllowDragging := .F. oItems := oGrid:Items() h := oItems:AddItem("R1") h2 := oItems:InsertItem(h,,"S") oItems:InsertItem(h2,,"C1") oItems:InsertItem(h2,,"C2") oItems:InsertItem(h,,"C1") oItems:InsertItem(h,,"C2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("R2") oItems:InsertItem(h,,"C1") oItems:InsertItem(h,,"C2") oGrid:ApplyFilter() oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1139 |
How can I display the total/sum/aggregate in the same column, when the user groups by a column
PROCEDURE OnAddColumn(oGrid,Column) RETURN PROCEDURE OnAddGroupItem(oGrid,Item) LOCAL oItems oItems := oGrid:Items() oItems:SetProperty("ItemDivider",Item,-1) oItems:SetProperty("ItemBackColor",Item,oGrid:BackColorSortBar()) oItems:SetProperty("ItemHeight",Item,oGrid:HeaderHeight()) oItems:SetProperty("CellMerge",Item,0,"1,2,3,4,5,7,8,9,10,11,12") oItems:SetProperty("CellValue",Item,13,"count(current,rec,1)") oItems:SetProperty("CellValueFormat",Item,13,5/*exTotalField+exHTML*/) oItems:SetProperty("CellValue",Item,0,oItems:CellCaption(Item,oItems:GroupItem(Item))) oItems:SetProperty("FormatCell",Item,0,"`<b>` + value + `</b> <font ;7><off 3><fgcolor=808080>(` + %13 + `)`") oItems:SetProperty("CellValue",Item,6,"sum(current,all,dbl(%6))") oItems:SetProperty("CellValueFormat",Item,6,5/*exTotalField+exHTML*/) oItems:SetProperty("CellForeColor",Item,6,AutomationTranslateColor( GraMakeRGBColor ( { 102,102,102 } ) , .F. )) RETURN 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 LOCAL oColumns LOCAL oItems LOCAL hL 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:AddColumn := {|Column| OnAddColumn(oGrid,Column)} /*Fired after a new column has been added.*/ oGrid:AddGroupItem := {|Item| OnAddGroupItem(oGrid,Item)} /*Occurs after a new Group Item has been inserted to Items collection.*/ oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/ oGrid:BeginUpdate() oGrid:LinesAtRoot := 5/*exGroupLinesOutside*/ oGrid:Indent := 12 oGrid:ColumnAutoResize := .F. oGrid:ScrollBySingleLine := .T. oGrid:SetProperty("BackColorSortBar",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oGrid:AutoDrag := 16/*exAutoDragScroll*/ rs := CreateObject("ADOR.Recordset") rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/) oGrid:DataSource := rs oGrid:SingleSort := .F. oGrid:SortBarVisible := .T. oGrid:AllowGroupBy := .T. oGrid:HeaderHeight := 24 oColumns := oGrid:Columns() oColumns:Add("Count"):Visible := .F. oColumn := oColumns:Item("Freight") oColumn:SetProperty("Def",4/*exCellBackColor*/,oGrid:BackColorSortBar()) oColumn:SetProperty("Def",7/*exHeaderBackColor*/,oColumn:Def(4/*exCellBackColor*/)) oColumn:SetProperty("Def",49/*exCellPaddingRight*/,4) oColumn:SetProperty("Def",48/*exCellPaddingLeft*/,4) oColumn:HeaderBold := .T. oColumn:AllowGroupBy := .F. oColumn:FormatColumn := "value format ``" oColumn:Alignment := 2/*RightAlignment*/ oColumn1 := oColumns:Item(0) oColumn1:AllowGroupBy := .F. oColumn1:SetProperty("Def",17/*exCellValueFormat*/,1) oColumns:Item("ShipCountry"):SortOrder := 1/*SortAscending*/ oGrid:ScrollBySingleLine := .F. oItems := oGrid:Items() oItems:SetProperty("LockedItemCount",2/*exBottom*/,1) hL := oItems:LockedItem(2/*exBottom*/,0) oItems:SetProperty("ItemHeight",hL,24) oItems:SetProperty("ItemBold",hL,.T.) oItems:SetProperty("ItemBackColor",hL,oGrid:BackColorSortBar()) oItems:SetProperty("CellValue",hL,6,"sum(all,rec,dbl(%6))") oItems:SetProperty("CellValueFormat",hL,6,5/*exTotalField+exHTML*/) oItems:SetProperty("CellHAlignment",hL,6,2/*RightAlignment*/) oItems:SetProperty("FormatCell",hL,6,"value format ``") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1138 |
I would like to display a solid line between "root" items, and dotted lines (default) between child items. How can I do that
#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 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:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:DrawGridLines := 1/*exHLines*/ oGrid:GridLineStyle := 512/*exGridLinesGeometric*/ oGrid:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAEhABMsIQAAYAQGKIcBiAKBQAGaAoDgYN4MAANAwjJBMKgBBCLIxhEYobgmGIXRpFMbxAKQahLEiTIgGUYJHgmK4tQLHb7zGAABRDDSOIDnGQJXhaI4JQSMMQDGLAZxVFiPRhAWLpBh+PQATrOdLUfSjVwhBKAQEBA==") oColumn := oGrid:Columns():Add("Default") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oColumn1 := oGrid:Columns():Add("Position") oColumn1:FormatColumn := "((1 rindex ``) contains `.`) = 0" oColumn1:Visible := .F. oConditionalFormat := oGrid:ConditionalFormats():Add("%C1") oConditionalFormat:SetProperty("BackColor",0x1e0e0e0) oItems := oGrid:Items() h := oItems:AddItem("Root 1") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:InsertItem(h,,"Child 3") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Root 2") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") h := oItems:AddItem("Root 3") oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1137 |
I can not center or align the cell's caption and icon, when it displays the hierarchy
#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,hChild 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:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=") oColumn := oGrid:Columns():Add("Tasks") oColumn:SetProperty("Def",17/*exCellValueFormat*/,1) oGrid:HeaderVisible := .T. oItems := oGrid:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"<img>1</img> Task (left)") hChild := oItems:InsertItem(h,,"<c><img>2</img> Task (center)") hChild := oItems:InsertItem(h,,"<r>Task (right) <img>3</img>") 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 |
1136 |
How do I mask for float/integer number
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGrid LOCAL oEditor,oEditor1,oEditor2,oEditor3,oEditor4,oEditor5,oEditor6,oEditor7,oEditor8 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:ColumnAutoResize := .T. oGrid:Columns():Add("Type"):Width := 32 oGrid:Columns():Add("Editor") oItems := oGrid:Items() h := oItems:AddItem("Integer") oItems:SetProperty("CellValue",h,1,"12") oEditor := oItems:CellEditor(h,1) oEditor:EditType := 1/*EditType*/ oEditor:Numeric := -1/*exInteger*/ h := oItems:AddItem("Integer (mask, group)") oItems:SetProperty("CellValue",h,1,"10002") oItems:SetProperty("FormatCell",h,1,"value format `0||`") oEditor1 := oItems:CellEditor(h,1) oEditor1:EditType := 8/*MaskType*/ oEditor1:Mask := ";;;float,digits=0,invalid=empty,warning=invalid character" h := oItems:AddItem("Integer (mask, no group)") oItems:SetProperty("CellValue",h,1,"10002") oItems:SetProperty("FormatCell",h,1,"value format `0|0|`") oEditor2 := oItems:CellEditor(h,1) oEditor2:EditType := 8/*MaskType*/ oEditor2:Mask := ";;;float,digits=0,grouping=,invalid=empty,warning=invalid character" h := oItems:AddItem("Float") oItems:SetProperty("CellValue",h,1,"+12.34E+2") oEditor3 := oItems:CellEditor(h,1) oEditor3:EditType := 1/*EditType*/ oEditor3:Numeric := 1/*exFloat*/ h := oItems:AddItem("Float (no signs)") oItems:SetProperty("CellValue",h,1,"12.34E-2") oEditor4 := oItems:CellEditor(h,1) oEditor4:EditType := 1/*EditType*/ oEditor4:Numeric := 769/*exDisableSigns+exFloat*/ h := oItems:AddItem("Float-Integer") oItems:SetProperty("CellValue",h,1,"+12.34") oEditor5 := oItems:CellEditor(h,1) oEditor5:EditType := 1/*EditType*/ oEditor5:Numeric := 2/*exFloatInteger*/ h := oItems:AddItem("Float-Integer (no signs)") oItems:SetProperty("CellValue",h,1,"12.34") oEditor6 := oItems:CellEditor(h,1) oEditor6:EditType := 1/*EditType*/ oEditor6:Numeric := 770/*exDisableSigns+exFloatInteger*/ h := oItems:AddItem("Float (mask,group)") oItems:SetProperty("CellValue",h,1,"10002.34") oItems:SetProperty("FormatCell",h,1,"value format `2`") oEditor7 := oItems:CellEditor(h,1) oEditor7:EditType := 8/*MaskType*/ oEditor7:Mask := ";;;float,invalid=empty,warning=invalid character" h := oItems:AddItem("Float (mask, no group)") oItems:SetProperty("CellValue",h,1,"10002.34") oItems:SetProperty("FormatCell",h,1,"value format `2|0|`") oEditor8 := oItems:CellEditor(h,1) oEditor8:EditType := 8/*MaskType*/ oEditor8:Mask := ";;;float,grouping=,invalid=empty,warning=invalid character" oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1135 |
How do I set an extra data for each item
PROCEDURE OnMouseMove(oGrid,Button,Shift,X,Y) LOCAL i i := oGrid:ItemFromPoint(-1,-1,c,hit) DevOut( Transform(i,"") ) DevOut( Transform(oGrid:Items:ItemData(i),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGrid LOCAL oItems,oItems1 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:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oGrid,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/ oGrid:BeginUpdate() oGrid:ColumnAutoResize := .T. oGrid:Columns():Add("Default") oItems := oGrid:Items() oItems:SetProperty("ItemData",oItems:AddItem("method 1"),"your extra data of method 1") oItems:InsertItem(0,"your extra data of method 2","method 2") oItems1 := oGrid:Items() oItems1:DefaultItem := oItems1:AddItem("method 3") oItems1:SetProperty("ItemData",0,"your extra data of method 3") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1134 |
I do not like to specify the item padding for every column I add. The question is how can I do it 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 oColumns 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:AttachTemplate("handle AddColumn(Column){Column{Def(48)=8;Def(49)=8;AllowDragging=False;AllowSizing = True}}") oGrid:HeaderAppearance := 4/*Etched*/ oGrid:DrawGridLines := -1/*exAllLines*/ oGrid:GridLineStyle := 32/*exGridLinesVSolid*/ oColumns := oGrid:Columns() oColumns:Add("Item") oColumn := oColumns:Add("Pos") oColumn:Position := 0 oColumn:Width := 32 oColumn:AllowSizing := .F. oColumn:FormatColumn := "1 index ``" oItems := oGrid:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1133 |
How can I change the Exclude field in the drop down filter window
#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:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:SetProperty("HTMLPicture","exclude","gCJKBOI4NBQaBQAhQNJJIIhShQACERCAEAcRdrdcUQhQDOZCJJUBEjbbhJ7giIJOBILJziJvl4BeKibhDiIZOhFLB0KZvMx0O5hORlAB3owuNJuNZzMZhOBlFxvORnTbuHgaiIeKBMKhFf9fDIcEoPCAVEAlGI4HhBBYMCARCQVGg4IhVMCAWC2XY1Q7WJ8RBB0KROKYAYDBbzicjndD6fA/VsRHRJIhBkRbMYIGwGAQjA2fRYOEBoYjBFBx1ATCgCGQ8M7OTjSaJMDRDKIwYu5DrIMBgSAADKJTqhBhyRApAA3FAucZPPilokRJJFJxEVxCMCCgIA==") oGrid:SetProperty("Description",25/*exFilterBarExclude*/,"<img>exclude</img>") oColumn := oGrid:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/ 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") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1132 |
How can I change the Exclude field in the drop down filter window
#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:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:SetProperty("Description",25/*exFilterBarExclude*/,"<bgcolor 0><fgcolor ffffff> Exclude </fgcolor></bgcolor>") oColumn := oGrid:Columns():Add("Items") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/ 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") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1131 |
The grid lines looks different then before. What should I do
#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,hChild 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:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:DrawGridLines := -1/*exAllLines*/ oGrid:GridLineStyle := 512/*exGridLinesGeometric*/ oColumn := oGrid:Columns():Add("Tasks") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:PartialCheck := .T. oGrid:HeaderVisible := .T. oItems := oGrid:Items() h := oItems:AddItem("Project") hChild := oItems:InsertItem(h,,"Task 1") oItems:SetProperty("SelectItem",hChild,.T.) hChild := oItems:InsertItem(h,,"Task 2") oItems:SetProperty("CellState",hChild,0,1) hChild := oItems:InsertItem(h,,"Task 3") oItems:SetProperty("CellState",hChild,0,1) 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 |
1130 |
Can I sort the column by check-state
#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() oColumn := oGrid:Columns():Add("Check") oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.) oColumn:SortType := 32/*exSortByState*/ oItems := oGrid:Items() oItems:AddItem() oItems:SetProperty("CellState",oItems:AddItem(),0,1) oItems:SetProperty("CellState",oItems:AddItem(),0,1) oItems:AddItem() oGrid:Columns:Item(0):SortOrder := 1/*SortAscending*/ oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1129 |
Can I sort the column by image
#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:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=") oColumn := oGrid:Columns():Add("Image") oColumn:SortType := 48/*exSortByImage*/ oItems := oGrid:Items() oItems:SetProperty("CellImage",oItems:AddItem(),0,3) oItems:AddItem() oItems:SetProperty("CellImage",oItems:AddItem(),0,1) oItems:SetProperty("CellImage",oItems:AddItem(),0,2) oGrid:Columns:Item(0):SortOrder := 1/*SortAscending*/ oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1128 |
Can I sort the column by value(numeric)
#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() oColumn := oGrid:Columns():Add("Value") oColumn:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn:FormatColumn := "`<fgcolor=808080><off 4><font ;6> ` + (1 index ``) + ` </font></off></fgcolor>` + value" oColumn:SortType := 17/*exSortByValue+SortNumeric*/ oItems := oGrid:Items() oItems:AddItem("1") oItems:AddItem("10") oItems:AddItem("2") oItems:AddItem("20") oGrid:Columns:Item(0):SortOrder := 1/*SortAscending*/ oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1127 |
Can I sort a column by cell's state (checked, unchecked) rather than caption
#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() oColumn := oGrid:Columns():Add("Check") oEditor := oColumn:Editor() oEditor:EditType := 19/*CheckValueType*/ oEditor:SetProperty("Option",17/*exCheckValue2*/,1) oColumn:SortType := 1/*SortNumeric*/ oItems := oGrid:Items() oItems:AddItem(.T.) oItems:AddItem(.F.) oItems:AddItem(.F.) oItems:AddItem(.T.) oGrid:Columns:Item(0):SortOrder := 1/*SortAscending*/ oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1126 |
How do I get the item's auto-number, when using FormatColumn property, as CellValue gets empty
PROCEDURE OnSelectionChanged(oGrid) LOCAL oItems oItems := oGrid:Items() DevOut( "pos: " ) DevOut( oItems:CellCaption(oItems:FocusItem(),1) ) DevOut( "rpos(1): " ) DevOut( oItems:CellCaption(oItems:FocusItem(),2) ) DevOut( "rpos(2): " ) DevOut( oItems:CellCaption(oItems:FocusItem(),3) ) DevOut( "apos: " ) DevOut( oItems:CellCaption(oItems:FocusItem(),4) ) DevOut( "index: " ) DevOut( oItems:CellCaption(oItems:FocusItem(),5) ) 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,oColumn3,oColumn4 LOCAL oColumns LOCAL oItems LOCAL h,hSel 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:SelectionChanged := {|| OnSelectionChanged(oGrid)} /*Fired after a new item has been selected.*/ oGrid:BeginUpdate() oGrid:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:DrawGridLines := -2/*exRowLines*/ oGrid:HeaderAppearance := 4/*Etched*/ oColumns := oGrid:Columns() oColumns:Add("Items") oColumn := oColumns:Add("pos") oColumn:FormatColumn := "1 pos ``" oColumn:Position := 0 oColumn:Width := 48 oColumn:AllowSizing := .F. oColumn1 := oColumns:Add("rpos(1)") oColumn1:FormatColumn := "1 rpos ``" oColumn1:Position := 1 oColumn1:Width := 48 oColumn1:AllowSizing := .F. oColumn2 := oColumns:Add("rpos(2)") oColumn2:FormatColumn := "1 rpos `.||A-Z`" oColumn2:Position := 2 oColumn2:Width := 48 oColumn2:AllowSizing := .F. oColumn3 := oColumns:Add("apos") oColumn3:FormatColumn := "1 apos ``" oColumn3:Position := 3 oColumn3:Width := 48 oColumn3:AllowSizing := .F. oColumn4 := oColumns:Add("index") oColumn4:FormatColumn := "1 index ``" oColumn4:Position := 4 oColumn4:Width := 48 oColumn4:AllowSizing := .F. oItems := oGrid:Items() h := oItems:AddItem("Item 1") oItems:InsertItem(h,,"Child 1") hSel := oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) oItems:AddItem("Item 2") oItems:AddItem("Item 3") oGrid:EndUpdate() oGrid:Items():SetProperty("SelectItem",hSel,.T.) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1125 |
How can I display UNICODE characters
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGrid LOCAL oItems LOCAL oStdFont 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() oStdFont := oGrid:Font() oStdFont:Name := "Arial Unicode" oStdFont:Size := 22 oGrid:HeaderVisible := .F. oGrid:DefaultItemHeight := 48 oGrid:Columns():Add(""):SetProperty("Def",17/*exCellValueFormat*/,1) oItems := oGrid:Items() oItems:AddItem("Ӓӓ") oItems:AddItem("ᦜᦝ;ᦞ") oItems:AddItem("ɮɭ;ɯ") oItems:AddItem("勳勴勵勶") oItems:SetProperty("FormatCell",oItems:AddItem(oGrid:Version()),0,"(value lfind `UNICODE`) < 0 ? `<fgcolor=FF0000><b>!UNICODE!</b> version</fgcolor> required: ` + value : `` ") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1124 |
How do I display the position of the item with 0-padding
#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("Items"):FormatColumn := "((1 apos ``) lpad `00`) + `. ` + value" oItems := oGrid:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oItems:AddItem("Item D") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1123 |
Can't get the +/- to be displayed on a divider item. What else can I do
#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 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:LinesAtRoot := -1/*exLinesAtRoot*/ oGrid:DrawGridLines := -1/*exAllLines*/ oGrid:TreeColumnIndex := 0 oGrid:MarkSearchColumn := .F. oGrid:FullRowSelect := 0/*exColumnSel*/ oGrid:HeaderAppearance := -1/*0xfffffff8+Bump+Sunken*/ oColumns := oGrid:Columns() oColumns:Add("C1"):Width := 32 oColumns:Add("C2"):FormatColumn := "1 index ``" oItems := oGrid:Items() h := oItems:AddItem("Cell 1") oItems:SetProperty("CellSingleLine",h,1,0/*exCaptionWordWrap*/) h := oItems:AddItem("This is bit of text merges all cells in the item (divider shows no +/-)") oItems:SetProperty("ItemDivider",h,0) oItems:SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oItems:SetProperty("ItemDividerLine",h,0/*EmptyLine*/) oItems:SetProperty("CellHAlignment",h,0,1/*CenterAlignment*/) oItems:InsertItem(h,,"Child 1") oItems:InsertItem(h,,"Child 2") oItems:SetProperty("ExpandItem",h,.T.) h := oItems:AddItem("Cell 3") h := oItems:AddItem("This is bit of text merges all cells in the item (merge shows +/-)") oItems:SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oItems:SetProperty("CellMerge",h,0,1) oItems:InsertItem(h,,"Child 3") oItems:InsertItem(h,,"Child 4") 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 |
1122 |
How can I define a column of button type
PROCEDURE OnButtonClick(oGrid,Item,ColIndex,Key) LOCAL oItems oItems := oGrid:Items() DevOut( Transform(oItems: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 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:ButtonClick := {|Item,ColIndex,Key| OnButtonClick(oGrid,Item,ColIndex,Key)} /*Occurs when user clicks on the cell's button.*/ oGrid:BeginUpdate() oColumn := oGrid:Columns():Add("Button") oColumn:SetProperty("Def",2/*exCellHasButton*/,.T.) oColumn:SetProperty("Def",3/*exCellButtonAutoWidth*/,.F.) oColumn:FormatColumn := "``" oColumn:AllowSizing := .F. oColumn:Width := 48 oGrid:Columns():Add("Second"):FormatColumn := "` Item ` + 1 index ``" oItems := oGrid:Items() oItems:AddItem("Button 1") oItems:AddItem("Button 2") oItems:AddItem("Button 3 ") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1121 |
Is it possible to configure different colour/icon when there is a active filter
PROCEDURE OnFilterChange(oGrid) oGrid:SetProperty("Background",0/*exHeaderFilterBarButton*/,oGrid:FormatABC("value = 0 ? 0x1000001 : 0x10000FF ",oGrid:Columns:Item(0):FilterType())) RETURN #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,oColumn1 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:FilterChange := {|| OnFilterChange(oGrid)} /*Occurs when filter was changed.*/ oGrid:BeginUpdate() oAppearance := oGrid:VisualAppearance() oAppearance:RenderType := -16777216 oAppearance:Add(1,"gBFLBCJwBAEHhEJAAEhABXUIQAAYAQGKIcBiAKBQAGYBIJDEMgzDDAUBjKKocQTC4AIQjCK4JDKHYJRpHEZyCA8EhqGASRAFUQBYiWE4oSpLABQaK0ZwIGyRIrkGQgQgmPYDSDNU4zVIEEglBI0TDNczhNDENgtGYaJqHIYpZBcM40TKkEZoSIITZcRrOEBiRL1S0RBhGcRUHZlWzdN64LhuK47UrWdD/XhdVzXRbjfz1Oq+bxve48Br7A5yYThdr4LhOFQ3RjIL4xbIcUwGe6VZhjOLZXjmO49T69HTtOCYBEBA") oGrid:DrawGridLines := -1/*exAllLines*/ oGrid:ShowFocusRect := .F. oGrid:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x1000001) oGrid:SetProperty("Background",32/*exCursorHoverColumn*/,-1) oGrid:HeaderAppearance := 4/*Etched*/ oGrid:SetProperty("BackColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oGrid:HeaderVisible := .T. oColumn := oGrid:Columns():Add("Filter") oColumn:DisplayFilterButton := .T. oColumn:AllowSort := .F. oColumn:AllowDragging := .F. oColumn:FilterList := 256/*exShowCheckBox*/ oItems := oGrid:Items() oItems:AddItem("Item A") oItems:AddItem("Item B") oItems:AddItem("Item C") oColumn1 := oGrid:Columns:Item(0) oColumn1:Filter := "Item B" oColumn1:FilterType := 240/*exFilter*/ oGrid:ApplyFilter() oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1120 |
How can I display the type of the value the column display
#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:HeaderAppearance := 4/*Etched*/ oGrid:DrawGridLines := -2/*exRowLines*/ oColumn := oGrid:Columns():Add("Values") oColumn:SetProperty("Def",17/*exCellValueFormat*/,1) oColumn:FormatColumn := "value + ` <off 4><fgcolor=808080>type(` + type(%0) + `)`" oItems := oGrid:Items() oItems:AddItem() oItems:AddItem(-1) oItems:AddItem("string") oItems:AddItem("01/01/2001") oItems:AddItem(2) oItems:AddItem(.T.) oItems:AddItem(12.34) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1119 |
I want to create a conditional format for a column, verifying that the value of the cell is numeric, how can I do
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGrid LOCAL oConditionalFormat 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:DrawGridLines := -2/*exRowLines*/ oGrid:Columns():Add("Values") oConditionalFormat := oGrid:ConditionalFormats():Add("type(%0) in (2,3,4,5,18,19,20,21)") oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oConditionalFormat:Bold := .T. oGrid:ConditionalFormats():Add("type(%0) = 11"):SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. )) oGrid:ConditionalFormats():Add("type(%0) = 7"):SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,255 } ) , .F. )) oGrid:ConditionalFormats():Add("type(%0) in (0,1)"):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oItems := oGrid:Items() oItems:AddItem() oItems:AddItem(-1) oItems:AddItem("string") oItems:AddItem("01/01/2001") oItems:AddItem(2) oItems:AddItem(.T.) oItems:AddItem(12.34) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1118 |
How can I assign a computed value on a different column based on other columns
PROCEDURE OnChange(oGrid,Item,ColIndex,NewValue) LOCAL oItems oGrid:FreezeEvents(.T.) oItems := oGrid:Items() oItems:SetProperty("CellValue",Item,1,oGrid:FormatABC("int(255*sin(value/2))",NewValue)) oItems:SetProperty("CellValue",Item,2,oGrid:FormatABC("int(255*cos(value/2))",NewValue)) oGrid:FreezeEvents(.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,var_Column 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:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/ oGrid:BeginUpdate() oGrid:SelBackMode := 1/*exTransparent*/ oGrid:HeaderAppearance := 4/*Etched*/ oGrid:DrawGridLines := -2/*exRowLines*/ oColumn := oGrid:Columns():Add("Value") oColumn:Editor():EditType := 4/*SpinType*/ oColumn:Width := 64 oColumn:AllowSizing := .F. oGrid:Columns():Add("Assign A"):SetProperty("Def",4/*exCellBackColor*/,16448250) oGrid:Columns():Add("Assign B"):SetProperty("Def",4/*exCellBackColor*/,16448250) var_Column := oGrid:Columns:Add("Computed") var_Column:SetProperty("Def",4/*exCellBackColor*/,16448250) var_Column:ComputedField := "%1 + %2" var_Column:FormatColumn := "value format ``" var_Column:Alignment := 2/*RightAlignment*/ var_Column:HeaderAlignment := var_Column:Alignment() oGrid:ConditionalFormats():Add("%3 >= 0"):Bold := .T. oItems := oGrid:Items() oItems:AddItem(1989) oItems:AddItem(2001) oItems:AddItem(2017) oItems:AddItem(2018) oItems:AddItem(2019) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1117 |
How can I get computed a value on a different column
#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:HeaderAppearance := 4/*Etched*/ oGrid:DrawGridLines := -2/*exRowLines*/ oColumn := oGrid:Columns():Add("Year") oColumn:Editor():EditType := 4/*SpinType*/ oColumn:Width := 64 oColumn:AllowSizing := .F. oGrid:Columns():Add("Easter"):FormatColumn := "date(dateS('3/1/' + %0) + ((1:=(((255 - 11 * (%0 mod 19)) - 21) mod 30) + 21) + (=:1 > 48 ? -1 : 0) + 6 - ((%0 + int(%0 / 4)) + =:1 + (=:1 > 48 ? -1 : 0) + 1) mod 7))" oItems := oGrid:Items() oItems:AddItem(1989) oItems:AddItem(2001) oItems:AddItem(2017) oItems:AddItem(2018) oItems:AddItem(2019) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1116 |
How can I prevent applying ConditionalFormats on a specified cell, for instance I am displaying a Total field, and I will like to have formatted in a different way (method 2)
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 LOCAL oConditionalFormat LOCAL oEditor LOCAL oItems,oItems1 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:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/ oGrid:BeginUpdate() oConditionalFormat := oGrid:ConditionalFormats():Add("(%0 >= 0)") oConditionalFormat:Expression := "(0=type(%CD0)) and (%0 >= 0)" oConditionalFormat:Bold := .T. oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) DevOut( "ConditionalFormat.Valid" ) DevOut( Transform(oConditionalFormat:Valid(),"") ) oColumn := oGrid:Columns():Add("Numbers") oEditor := oColumn:Editor() oEditor:Numeric := -1/*exInteger*/ oEditor:EditType := 4/*SpinType*/ oColumn:SortType := 1/*SortNumeric*/ oItems := oGrid:Items() oItems:AddItem(100) oItems:AddItem(-25) oItems:AddItem(31) oItems:AddItem(-48) oItems1 := oGrid:Items() h := oItems1:AddItem("sum(all,dir,dbl(%0))") oItems1:SetProperty("SelectableItem",h,.F.) oItems1:SetProperty("SortableItem",h,.F.) oItems1:SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oItems1:SetProperty("CellData",h,0,"total") oItems1:SetProperty("CellValueFormat",h,0,5/*exTotalField+exHTML*/) oItems1:SetProperty("FormatCell",h,0,"'Total: <b><fgcolor=0000FF>'+(value format ``)") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1115 |
How can I prevent applying ConditionalFormats on a specified cell, for instance I am displaying a Total field, and I will like to have formatted in a different way (method 1)
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 LOCAL oConditionalFormat LOCAL oEditor LOCAL oItems,oItems1 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:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/ oGrid:BeginUpdate() oConditionalFormat := oGrid:ConditionalFormats():Add("%0 >= 0") oConditionalFormat:Bold := .T. oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oConditionalFormat:ApplyTo := 0/*exFormatToColumns*/ oColumn := oGrid:Columns():Add("Numbers") oEditor := oColumn:Editor() oEditor:Numeric := -1/*exInteger*/ oEditor:EditType := 4/*SpinType*/ oColumn:SortType := 1/*SortNumeric*/ oGrid:Columns():Add("Total"):Visible := .F. oItems := oGrid:Items() oItems:SetProperty("LockedItemCount",2/*exBottom*/,1) h := oItems:LockedItem(2/*exBottom*/,0) oItems:SetProperty("ItemDivider",h,1) oItems:SetProperty("ItemDividerLine",h,0/*EmptyLine*/) oItems:SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oItems:SetProperty("CellValue",h,1,"sum(all,dir,dbl(%0))") oItems:SetProperty("CellValueFormat",h,1,5/*exTotalField+exHTML*/) oItems:SetProperty("CellHAlignment",h,1,2/*RightAlignment*/) oItems:SetProperty("FormatCell",h,1,"'Total: <b><fgcolor=0000FF>'+(value format ``)") oItems1 := oGrid:Items() oItems1:AddItem(100) oItems1:AddItem(-25) oItems1:AddItem(31) oItems1:AddItem(-48) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1114 |
ADODB Requery sample
PROCEDURE OnButtonClick(oGrid,Item,ColIndex,Key) LOCAL cmd cmd := CreateObject("ADODB.Command") cmd:ActiveConnection := oGrid:DataSource():ActiveConnection() cmd:CommandText := "INSERT INTO Orders (EmployeeID) VALUES(12345)" cmd:CommandType := 1/*adCmdText*/ cmd:Execute() oGrid:DataSource():Requery() RETURN PROCEDURE OnError(oGrid,Error,Description) DevOut( Transform(Description,"") ) RETURN #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 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:ButtonClick := {|Item,ColIndex,Key| OnButtonClick(oGrid,Item,ColIndex,Key)} /*Occurs when user clicks on the cell's button.*/ oGrid:Error := {|Error,Description| OnError(oGrid,Error,Description)} /*Fired when an internal error occurs.*/ oGrid:BeginUpdate() oGrid:HeaderAppearance := 4/*Etched*/ oGrid:ColumnAutoResize := .F. rs := CreateObject("ADODB.Recordset") rs:Open("Select * From Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",1/*adOpenKeyset*/,3/*adLockOptimistic*/) oGrid:DataSource := rs oGrid:ConditionalFormats():Add("%1=12345"):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oItems := oGrid:Items() oItems:SetProperty("LockedItemCount",0/*exTop*/,1) h := oItems:LockedItem(0/*exTop*/,0) oItems:SetProperty("ItemDivider",h,0) oItems:SetProperty("CellHasButton",h,0,.T.) oItems:SetProperty("CellValue",h,0,"Requery (add a new record, using ADODB.Command)") oItems:SetProperty("CellHAlignment",h,0,1/*CenterAlignment*/) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1113 |
I am using DetectAddNew property, but no new items is added when AddNew is performed
PROCEDURE OnButtonClick(oGrid,Item,ColIndex,Key) LOCAL oRecordset oRecordset := oGrid:DataSource() oRecordset:AddNew("EmployeeID",123) oRecordset:Update() RETURN PROCEDURE OnError(oGrid,Error,Description) DevOut( Transform(Description,"") ) RETURN #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 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:ButtonClick := {|Item,ColIndex,Key| OnButtonClick(oGrid,Item,ColIndex,Key)} /*Occurs when user clicks on the cell's button.*/ oGrid:Error := {|Error,Description| OnError(oGrid,Error,Description)} /*Fired when an internal error occurs.*/ oGrid:BeginUpdate() oGrid:HeaderAppearance := 4/*Etched*/ oGrid:ColumnAutoResize := .F. rs := CreateObject("ADODB.Recordset") rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",1/*adOpenKeyset*/,3/*adLockOptimistic*/) oGrid:DataSource := rs oItems := oGrid:Items() oItems:SetProperty("LockedItemCount",0/*exTop*/,1) h := oItems:LockedItem(0/*exTop*/,0) oItems:SetProperty("ItemDivider",h,0) oItems:SetProperty("CellHasButton",h,0,.T.) oItems:SetProperty("CellValue",h,0,"AddNew") oItems:SetProperty("CellHAlignment",h,0,1/*CenterAlignment*/) oGrid:DetectAddNew := .T. oGrid:DetectDelete := .T. oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1112 |
I am skinning the control's header-bar, but the background of the header-bar is shown on each item in the filter-bar drop down panel. What can I do
#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:Add(1,"gBFLBCJwBAEHhEJAAEhABFgDg6AADACAxRDgMQBQKAAzQFAYcBqGqGAAGQZxYgmFgAQhFcZQSKUOQTDKMIziYBYfgkMIgSbJUgDGAkRRdDSOYDmGQYDiCIoRShOMIjHLUXxtDaIZwhEAoJb+RgAUY/cTzaAEUwHHiTKInaCQGhsCYJUJAdRURQ9EwvCIZBpEWwLChENQwWLCNj2TScBwjCyqbale45ViqdoDU8lORLUi+M4zSBPcZVTRtGShPDBKTjMKKYgkG4lVpRNa0PC1GTzQ6mazkKQLRADDIDVbAeL3LiMBy9LyLLItQALByua5mWhbcZyBCOPgBTrRb5zO58FjuTK7YLjMB7NrUNYtFaUMy2OpOCADIaecTNcaWLxPF2MY1HWYxVj2Jw3DuRJonKYBgggSRAlIYw6B0ThGFgPAkFUDAhBMfZRiGNAkFECZnm4YQdneJwqnsSQrGAAhWAIJBJBIQgFCQIBiEIAglgqYo0i4V4MEgRI9gSToYFS" +; "b4Fk6Y4+BmBZhFOJgTC8TBogQAArgqco4muCZOkOMJtgmYpIjYKg7GKE4uCUK4AAKKg2DwI4DiCZw5k6KJ2D6D4OHiag4DwIxiiQAArAqMosnEPBPAOIhOg+DozjIJ4PGSY4iEwPAkhKLhHUUSQsnKFCnkYU9MjORhcCsAAIACLQ8iaSJ6FKC5jJoaobA8KYoACCRKnmMJzhuDpZnSboMCKGJ4nMPIPDmYAACwKIDk6CoLCeU40m6I5oliMoKDyaICokLIpgoThviOKJoGYf4KmUKhMjMLJLCAAojCyaYoiYGoGmqM46CkOwPE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gHgYgyH8B54lQU4NkMeJlBoDgjkiXBTg0R54iYIR+koeQVBoKpkgkChKhEJBkF4SFEjkDgJhFQoeEmDJlBeehUhWJQJGIXoICWOQ6FeFIlhkfhlDsSJpiQVoamaSY2G6G5nAmRhpCOH5pkwVYdmeCZmHqHpnkmdhzhmaAIFiax8AABAEICA==") oGrid:SetProperty("BackColorHeader",0x1000000) oGrid:SetProperty("ForeColorHeader",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oGrid:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x2000000) oGrid:SetProperty("Background",26/*exBackColorFilter*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oGrid:SetProperty("Background",27/*exForeColorFilter*/,AutomationTranslateColor( GraMakeRGBColor ( { 0,0,1 } ) , .F. )) oGrid:SetProperty("Background",20/*exSelBackColorFilter*/,0x1ff8000) oGrid:SetProperty("Background",21/*exSelForeColorFilter*/,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) oGrid:SetProperty("Background",32/*exCursorHoverColumn*/,-1) oGrid:HeaderHeight := 24 oGrid:SetProperty("BackColorLevelHeader",oGrid:BackColor()) oColumn := oGrid:Columns():Add("Filter") oColumn:DisplayFilterButton := .T. oColumn:DisplayFilterPattern := .F. oColumn:FilterList := 9504/*exShowExclude+exShowFocusItem+exShowCheckBox+exSortItemsAsc*/ oColumn:SetProperty("Def",52/*exHeaderPaddingLeft*/,2) oColumn:SetProperty("Def",53/*exHeaderPaddingRight*/,2) oItems := oGrid:Items() oItems:AddItem("A") oItems:AddItem("B") oItems:AddItem("C") oItems:AddItem("D") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1111 |
How can I change the font for entire column (method 3)
PROCEDURE OnAddItem(oGrid,Item) LOCAL oItems oItems := oGrid:Items() oItems:SetProperty("CellFont",Item,1,oGrid:Columns:Item(1):Data()) oItems:SetProperty("CellBold",Item,1,.T.) oItems:SetProperty("CellForeColor",Item,1,AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .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 oItems LOCAL f 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:BeginUpdate() oGrid:HeaderHeight := 24 oGrid:HeaderAppearance := 4/*Etched*/ oGrid:Columns():Add("C1") oColumn := oGrid:Columns():Add("C2") oColumn:HTMLCaption := "<b><font Tahoma;14>C2" f := CreateObject("StdFont") f:Name := "Tahoma" f:Size := 11 oColumn:Data := f oItems := oGrid:Items() oItems:SetProperty("CellValue",oItems:AddItem(10),1,11) oItems:SetProperty("CellValue",oItems:AddItem(12),1,13) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1110 |
How can I change the font for entire column (method 2)
PROCEDURE OnAddItem(oGrid,Item) LOCAL oItems LOCAL f oItems := oGrid:Items() f := CreateObject("StdFont") f:Name := "Tahoma" f:Size := 11 oItems:SetProperty("CellFont",Item,1,f) oItems:SetProperty("CellBold",Item,1,.T.) oItems:SetProperty("CellForeColor",Item,1,AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) 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:AddItem := {|Item| OnAddItem(oGrid,Item)} /*Occurs after a new Item has been inserted to Items collection.*/ oGrid:BeginUpdate() oGrid:HeaderHeight := 24 oGrid:HeaderAppearance := 4/*Etched*/ oGrid:Columns():Add("C1") oGrid:Columns():Add("C2"):HTMLCaption := "<b><font Tahoma;14>C2" oItems := oGrid:Items() oItems:SetProperty("CellValue",oItems:AddItem(10),1,11) oItems:SetProperty("CellValue",oItems:AddItem(12),1,13) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1109 |
How can I change the font for entire column (method 1)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGrid LOCAL oConditionalFormat LOCAL oItems LOCAL f 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() oConditionalFormat := oGrid:ConditionalFormats():Add("1") oConditionalFormat:Bold := .T. oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) f := CreateObject("StdFont") f:Name := "Tahoma" f:Size := 11 oConditionalFormat:Font := f oConditionalFormat:ApplyTo := 1/*0x1+*/ oGrid:HeaderHeight := 24 oGrid:HeaderAppearance := 4/*Etched*/ oGrid:Columns():Add("C1") oGrid:Columns():Add("C2"):HTMLCaption := "<b><font Tahoma;14>C2" oItems := oGrid:Items() oItems:SetProperty("CellValue",oItems:AddItem(10),1,11) oItems:SetProperty("CellValue",oItems:AddItem(12),1,13) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1108 |
I am using ExComboBox as an user editor, how can I display a different column
PROCEDURE OnUserEditorClose(oGrid,Object,Item,ColIndex) /*Items.CellValue(Item,ColIndex) = Object.Select("OrderID")*/ RETURN PROCEDURE OnUserEditorOleEvent(oGrid,Object,Ev,CloseEditor,Item,ColIndex) DevOut( Transform(Ev,"") ) RETURN PROCEDURE OnUserEditorOpen(oGrid,Object,Item,ColIndex) /*Object.Select("OrderID") = Me.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 LOCAL oEditor LOCAL oItems LOCAL h,oObject 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:UserEditorClose := {|Object,Item,ColIndex| OnUserEditorClose(oGrid,Object,Item,ColIndex)} /*Fired the user editor is about to be opened.*/ oGrid:UserEditorOleEvent := {|Object,Ev,CloseEditor,Item,ColIndex| OnUserEditorOleEvent(oGrid,Object,Ev,CloseEditor,Item,ColIndex)} /*Occurs when an user editor fires an event.*/ oGrid:UserEditorOpen := {|Object,Item,ColIndex| OnUserEditorOpen(oGrid,Object,Item,ColIndex)} /*Occurs when an user editor is about to be opened.*/ oGrid:BeginUpdate() oGrid:SortOnClick := 0/*exNoSort*/ oEditor := oGrid:Columns():Add("Exontrol.ComboBox"):Editor() oEditor:EditType := 16/*UserEditorType*/ oEditor:UserEditor("Exontrol.ComboBox","") oObject := oEditor:UserEditorObject() oGrid:DrawGridLines := -2/*exRowLines*/ oGrid:TreeColumnIndex := -1 oGrid:DefaultItemHeight := 21 oItems := oGrid:Items() h := oItems:AddItem("shows always the drop-down editor") oItems:SetProperty("CellHAlignment",h,0,1/*CenterAlignment*/) oItems:SetProperty("ItemDivider",h,0) oItems:SetProperty("ItemDividerLineAlignment",h,1/*DividerCenter*/) oItems:SetProperty("SelectableItem",h,.F.) oItems:SetProperty("EnableItem",h,.F.) oItems:SetProperty("CellEditorVisible",oItems:AddItem(10248),0,1/*exEditorVisible*/) oItems:SetProperty("CellEditorVisible",oItems:AddItem(10249),0,1/*exEditorVisible*/) oItems:SetProperty("CellEditorVisible",oItems:AddItem(10250),0,1/*exEditorVisible*/) h := oItems:AddItem("shows the drop-down editor when user clicks it") oItems:SetProperty("CellHAlignment",h,0,1/*CenterAlignment*/) oItems:SetProperty("ItemDivider",h,0) oItems:SetProperty("ItemDividerLineAlignment",h,1/*DividerCenter*/) oItems:SetProperty("SelectableItem",h,.F.) oItems:SetProperty("EnableItem",h,.F.) oItems:AddItem(10248) oItems:AddItem(10249) oItems:AddItem(10250) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1107 |
The ItemHeight property is not working (method 2)
#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:ColumnAutoResize := .F. oGrid:ScrollBySingleLine := .T. oGrid:Columns():Add("Column"):Width := 128 oItems := oGrid:Items() oItems:SetProperty("CellSingleLine",oItems:AddItem("This is a bit of text that should break the line"),0,0/*exCaptionWordWrap*/) h := oItems:AddItem("") oItems:SetProperty("ItemDivider",h,0) oItems:SetProperty("SelectableItem",h,.F.) oItems:SetProperty("ItemDividerLineAlignment",h,1/*DividerCenter*/) oItems:SetProperty("ItemHeight",h,3) oItems:SetProperty("CellSingleLine",oItems:AddItem("This is a bit of text that should break the line"),0,0/*exCaptionWordWrap*/) oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1106 |
The ItemHeight property is not working (method 1)
#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:ColumnAutoResize := .F. oGrid:ScrollBySingleLine := .T. oColumn := oGrid:Columns():Add("Column") oColumn:Width := 128 oColumn:SetProperty("Def",16/*exCellSingleLine*/,0) oItems := oGrid:Items() oItems:AddItem("This is a bit of text that should break the line") h := oItems:AddItem("") oItems:SetProperty("ItemDivider",h,0) oItems:SetProperty("SelectableItem",h,.F.) oItems:SetProperty("ItemDividerLineAlignment",h,1/*DividerCenter*/) oItems:SetProperty("ItemMinHeight",h,3) oItems:SetProperty("ItemMaxHeight",h,3) oItems:AddItem("This is a bit of text that should break the line") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1105 |
How do I add a total field locked at the bottom of the control
PROCEDURE OnAddGroupItem(oGrid,Item) LOCAL oItems oItems := oGrid:Items() oItems:SetProperty("ItemDividerLine",Item,0/*EmptyLine*/) oItems:SetProperty("FormatCell",Item,oItems:GroupItem(Item),"value + ` Min: <b>` + %13 + `</b> Max: <b>` + %14 + `</b> Sum: <b>` + %15 + `</b>, of Freight column`") oItems:SetProperty("CellValue",Item,"Min","min(current,all,dbl(%6))") oItems:SetProperty("CellValueFormat",Item,"Min",4/*exTotalField*/) oItems:SetProperty("CellValue",Item,"Max","max(current,all,dbl(%6))") oItems:SetProperty("CellValueFormat",Item,"Max",4/*exTotalField*/) oItems:SetProperty("CellValue",Item,"Sum","sum(current,all,dbl(%6))") oItems:SetProperty("CellValueFormat",Item,"Sum",4/*exTotalField*/) oItems:SetProperty("ItemBackColor",Item,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) RETURN 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,var_Column,var_Column1 LOCAL oColumns LOCAL oItems LOCAL hL 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:AddGroupItem := {|Item| OnAddGroupItem(oGrid,Item)} /*Occurs after a new Group Item has been inserted to Items collection.*/ oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/ oGrid:BeginUpdate() oGrid:HasLines := 0/*exNoLine*/ oGrid:SetProperty("Description",26/*exColumnsFloatBar*/,"Show/Hide") oGrid:ColumnsFloatBarSortOrder := 1/*SortAscending*/ oGrid:ColumnsFloatBarVisible := 2/*exColumnsFloatBarVisibleIncludeCheckColumns*/ oGrid:ColumnAutoResize := .F. oGrid:SetProperty("BackColorSortBar",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) rs := CreateObject("ADOR.Recordset") rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/) oGrid:DataSource := rs oGrid:SingleSort := .F. oGrid:SortBarVisible := .T. oGrid:AllowGroupBy := .T. oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column." oColumns := oGrid:Columns() oColumn := oColumns:Add("Min") oColumn:Visible := .F. oColumn:AllowDragging := .F. var_Column := oColumns:Add("Max") var_Column:Visible := .F. var_Column:Visible := .F. var_Column:AllowDragging := .F. var_Column1 := oColumns:Add("Sum") var_Column1:Visible := .F. var_Column1:Visible := .F. var_Column1:AllowDragging := .F. oColumn1 := oGrid:Columns:Item("Freight") oColumn1:FormatColumn := "currency(value)" oColumn1:SetProperty("Def",4/*exCellBackColor*/,12895487) oColumn1:SetProperty("Def",7/*exHeaderBackColor*/,oColumn1:Def(4/*exCellBackColor*/)) oColumn1:HeaderBold := .T. oColumn1:AllowGroupBy := .F. oColumn1:Alignment := 2/*RightAlignment*/ oGrid:ScrollBySingleLine := .F. oItems := oGrid:Items() oItems:SetProperty("LockedItemCount",2/*exBottom*/,2) hL := oItems:LockedItem(2/*exBottom*/,0) oItems:SetProperty("ItemDivider",hL,0) oItems:SetProperty("ItemHeight",hL,3) oItems:SetProperty("ItemDividerLineAlignment",hL,2/*DividerTop*/) oItems:SetProperty("ItemDividerLine",hL,2/*DoubleLine*/) hL := oItems:LockedItem(2/*exBottom*/,1) oItems:SetProperty("CellValue",hL,6,"sum(all,rec,dbl(%6))") oItems:SetProperty("CellValueFormat",hL,6,4/*exTotalField*/) oItems:SetProperty("ItemHeight",hL,24) oItems:SetProperty("ItemBold",hL,.T.) oGrid:Columns:Item("EmployeeID"):SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/ oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1104 |
How can I add a total field, when I use grouping
PROCEDURE OnAddGroupItem(oGrid,Item) LOCAL oItems oItems := oGrid:Items() oItems:SetProperty("ItemDividerLine",Item,0/*EmptyLine*/) oItems:SetProperty("FormatCell",Item,oItems:GroupItem(Item),"value + ` Min: <b>` + %13 + `</b> Max: <b>` + %14 + `</b> Sum: <b>` + %15 + `</b>, of Freight column`") oItems:SetProperty("CellValue",Item,"Min","min(current,all,dbl(%6))") oItems:SetProperty("CellValueFormat",Item,"Min",4/*exTotalField*/) oItems:SetProperty("CellValue",Item,"Max","max(current,all,dbl(%6))") oItems:SetProperty("CellValueFormat",Item,"Max",4/*exTotalField*/) oItems:SetProperty("CellValue",Item,"Sum","sum(current,all,dbl(%6))") oItems:SetProperty("CellValueFormat",Item,"Sum",4/*exTotalField*/) oItems:SetProperty("ItemBackColor",Item,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) RETURN 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 LOCAL oColumns LOCAL oItems LOCAL hL 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:AddGroupItem := {|Item| OnAddGroupItem(oGrid,Item)} /*Occurs after a new Group Item has been inserted to Items collection.*/ oGrid:Change := {|Item,ColIndex,NewValue| OnChange(oGrid,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/ oGrid:BeginUpdate() oGrid:HasLines := 0/*exNoLine*/ oGrid:ColumnAutoResize := .F. oGrid:SetProperty("BackColorSortBar",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. )) rs := CreateObject("ADOR.Recordset") rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/) oGrid:DataSource := rs oGrid:SingleSort := .F. oGrid:SortBarVisible := .T. oGrid:AllowGroupBy := .T. oGrid:Columns:Item(1):SortOrder := -1/*0xfffffffc+SortDescending+SortAscending*/ oColumns := oGrid:Columns() oColumns:Add("Min"):Visible := .F. oColumns:Add("Max"):Visible := .F. oColumns:Add("Sum"):Visible := .F. oColumn := oGrid:Columns:Item("Freight") oColumn:SetProperty("Def",4/*exCellBackColor*/,12895487) oColumn:SetProperty("Def",7/*exHeaderBackColor*/,oColumn:Def(4/*exCellBackColor*/)) oColumn:HeaderBold := .T. oColumn:AllowGroupBy := .F. oGrid:ScrollBySingleLine := .F. oItems := oGrid:Items() oItems:SetProperty("LockedItemCount",2/*exBottom*/,1) hL := oItems:LockedItem(2/*exBottom*/,0) oItems:SetProperty("ItemDivider",hL,0) oItems:SetProperty("ItemHeight",hL,24) oItems:SetProperty("ItemDividerLineAlignment",hL,2/*DividerTop*/) oItems:SetProperty("ItemDividerLine",hL,2/*DoubleLine*/) oItems:SetProperty("CellValue",hL,0,"sum(all,rec,dbl(%6))") oItems:SetProperty("CellValueFormat",hL,0,5/*exTotalField+exHTML*/) oItems:SetProperty("CellHAlignment",hL,0,2/*RightAlignment*/) oItems:SetProperty("FormatCell",hL,0,"'Freight: <bgcolor=FFC4C4> '+(value format ``) + ` `") oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
1103 |
How do I use the ColumnsFloatBarVisible on exColumnsFloatBarVisibleIncludeCheckColumns
|
1102 |
How do I use the ColumnsFloatBarVisible on exColumnsFloatBarVisibleIncludeHiddenColumn
|
1101 |
How do I use the ColumnsFloatBarVisible on exColumnsFloatBarVisibleIncludeGroupByColumns
#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:ColumnAutoResize := .F. oGrid:HeaderAppearance := 4/*Etched*/ oColumns := oGrid:Columns() oColumns:Add("City") oColumns:Add("Start") oColumns:Add("End") oGrid:AllowGroupBy := .T. oGrid:SortBarVisible := .T. oGrid:SortBarCaption := "Drag a <b>column</b> header here to group by that column." oGrid:SetProperty("BackColorSortBar",AutomationTranslateColor( GraMakeRGBColor ( { 250,250,250 } ) , .F. )) oGrid:SetProperty("Description",26/*exColumnsFloatBar*/,"Group-By") oGrid:ColumnsFloatBarVisible := 1/*exColumnsFloatBarVisibleIncludeGroupByColumns*/ oGrid:ColumnsFloatBarSortOrder := 1/*SortAscending*/ oGrid:Columns:Item("City"):SortOrder := 1/*SortAscending*/ oGrid:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |