;1.0.2.0 EnableExplicit Global PBEx_GridGadget #PBEx_GridGadget_Version$ = "1.0.2.0" #PBEx_GridGadget_Flag_AllowAddRows = 1 #PBEx_GridGadget_Flag_AllowDeleteRows = 2 #PBEx_GridGadget_Flag_AllowOrderColumns = 4 #PBEx_GridGadget_Flag_AllowResizeColumns = 8 #PBEx_GridGadget_Flag_AllowResizeRows = 16 #PBEx_GridGadget_Flag_AllowResizeColumnHeight = 32 #PBEx_GridGadget_Flag_AllowResizeRowWidth = 64 #PBEx_GridGadget_Flag_HideColumnHeader = 128 #PBEx_GridGadget_Flag_HideRowHeader = 256 #PBEx_GridGadget_Flag_MultiSelect = 512 #PBEx_GridGadget_Flag_ReadOnly = 1024 #PBEx_GridGadget_Flag_AutoColumnWidth = 2048 #PBEx_GridGadget_Type_Text = 0 #PBEx_GridGadget_Type_Date = 7 #PBEx_GridGadget_Type_Lowercase = 12 #PBEx_GridGadget_Type_Uppercase = 13 #PBEx_GridGadget_Type_Percent = 15 #PBEx_GridGadget_Direction_Ascending = 0 #PBEx_GridGadget_Direction_Descending = 1 #PBEx_GridGadget_ColumnWidth_AutoColumnWidth = -1 #PBEx_GridGadget_Attribute_SelectType = 1 #PBEx_GridGadget_Attribute_SelectType_CellSelect = 1 #PBEx_GridGadget_Attribute_SelectType_FullRowSelect = 2 #PBEx_GridGadget_Attribute_SelectType_RowHeaderSelect = 4 #PBEx_GridGadget_ColorType_FrontColor = 1 #PBEx_GridGadget_ColorType_BackColor = 2 CompilerIf #PB_Compiler_Processor = #PB_Processor_x86 PBEx_GridGadget = OpenLibrary(#PB_Any, "PB.Ex_GridGadget_x86.dll") CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64 PBEx_GridGadget = OpenLibrary(#PB_Any, "PB.Ex_GridGadget_x64.dll") CompilerEndIf If PBEx_GridGadget Prototype GridGadget(ID, X, Y, Width, Height, Flags, ParentWindowID, ErrorOutput) Global GridGadget.GridGadget = GetFunction(PBEx_GridGadget, "GridGadget") Prototype AddGridGadgetColumn(ID, Position, Type, Text.p-Unicode, Width, ErrorOutput) Global AddGridGadgetColumn.AddGridGadgetColumn = GetFunction(PBEx_GridGadget, "AddGridGadgetColumn") Prototype RemoveGridGadgetColumn(ID, Position, ErrorOutput) Global RemoveGridGadgetColumn.RemoveGridGadgetColumn = GetFunction(PBEx_GridGadget, "RemoveGridGadgetColumn") Prototype AddGridGadgetItem(ID, Position, Text.p-Unicode, ErrorOutput) Global AddGridGadgetItem.AddGridGadgetItem = GetFunction(PBEx_GridGadget, "AddGridGadgetItem") Prototype RemoveGridGadgetItem(ID, Position, ErrorOutput) Global RemoveGridGadgetItem.RemoveGridGadgetItem = GetFunction(PBEx_GridGadget, "RemoveGridGadgetItem") Prototype CountGridGadgetColumns(ID, ErrorOutput) Global CountGridGadgetColumns.CountGridGadgetColumns = GetFunction(PBEx_GridGadget, "CountGridGadgetColumns") Prototype CountGridGadgetItems(ID, ErrorOutput) Global CountGridGadgetItems.CountGridGadgetItems = GetFunction(PBEx_GridGadget, "CountGridGadgetItems") Prototype ClearGridGadgetColumns(ID, ErrorOutput) Global ClearGridGadgetColumns.ClearGridGadgetColumns = GetFunction(PBEx_GridGadget, "ClearGridGadgetColumns") Prototype ClearGridGadgetItems(ID, ErrorOutput) Global ClearGridGadgetItems.ClearGridGadgetItems = GetFunction(PBEx_GridGadget, "ClearGridGadgetItems") Prototype GetGridGadgetColumnText(ID, Position, Output, ErrorOutput) Global GetGridGadgetColumnText.GetGridGadgetColumnText = GetFunction(PBEx_GridGadget, "GetGridGadgetColumnText") Prototype SetGridGadgetColumnText(ID, Position, Text.p-Unicode, ErrorOutput) Global SetGridGadgetColumnText.SetGridGadgetColumnText = GetFunction(PBEx_GridGadget, "SetGridGadgetColumnText") Prototype GetGridGadgetItemText(ID, Position, Column, Output, ErrorOutput) Global GetGridGadgetItemText.GetGridGadgetItemText = GetFunction(PBEx_GridGadget, "GetGridGadgetItemText") Prototype SetGridGadgetItemText(ID, Position, Column, Text.p-Unicode, ErrorOutput) Global SetGridGadgetItemText.SetGridGadgetItemText = GetFunction(PBEx_GridGadget, "SetGridGadgetItemText") Prototype FreeGridGadget(ID, ErrorOutput) Global FreeGridGadget.FreeGridGadget = GetFunction(PBEx_GridGadget, "FreeGridGadget") Prototype GridGadgetWidth(ID, ErrorOutput) Global GridGadgetWidth.GridGadgetWidth = GetFunction(PBEx_GridGadget, "GridGadgetWidth") Prototype GridGadgetHeight(ID, ErrorOutput) Global GridGadgetHeight.GridGadgetHeight = GetFunction(PBEx_GridGadget, "GridGadgetHeight") Prototype GridGadgetX(ID, ErrorOutput) Global GridGadgetX.GridGadgetX = GetFunction(PBEx_GridGadget, "GridGadgetX") Prototype GridGadgetY(ID, ErrorOutput) Global GridGadgetY.GridGadgetY = GetFunction(PBEx_GridGadget, "GridGadgetY") Prototype GridGadgetID(ID, ErrorOutput) Global GridGadgetID.GridGadgetID = GetFunction(PBEx_GridGadget, "GridGadgetID") Prototype HideGridGadget(ID, State, ErrorOutput) Global HideGridGadget.HideGridGadget = GetFunction(PBEx_GridGadget, "HideGridGadget") Prototype IsGridGadget(ID, ErrorOutput) Global IsGridGadget.IsGridGadget = GetFunction(PBEx_GridGadget, "IsGridGadget") Prototype ResizeGridGadget(ID, X, Y, Width, Height, ErrorOutput) Global ResizeGridGadget.ResizeGridGadget = GetFunction(PBEx_GridGadget, "ResizeGridGadget") Prototype SortGridGadgetColumn(ID, Column, Direction, ErrorOutput) Global SortGridGadgetColumn.SortGridGadgetColumn = GetFunction(PBEx_GridGadget, "SortGridGadgetColumn") Prototype DisableGridGadget(ID, State, ErrorOutput) Global DisableGridGadget.DisableGridGadget = GetFunction(PBEx_GridGadget, "DisableGridGadget") Prototype SetGridGadgetAttribute(ID, Attribute, Value, ErrorOutput) Global SetGridGadgetAttribute.SetGridGadgetAttribute = GetFunction(PBEx_GridGadget, "SetGridGadgetAttribute") Prototype GetGridGadgetAttribute(ID, Attribute, ErrorOutput) Global GetGridGadgetAttribute.GetGridGadgetAttribute = GetFunction(PBEx_GridGadget, "GetGridGadgetAttribute") Prototype GetGridGadgetState(ID, ErrorOutput) Global GetGridGadgetState.GetGridGadgetState = GetFunction(PBEx_GridGadget, "GetGridGadgetState") Prototype GetGridGadgetItemState(ID, Position, Column, ErrorOutput) Global GetGridGadgetItemState.GetGridGadgetItemState = GetFunction(PBEx_GridGadget, "GetGridGadgetItemState") Prototype SetGridGadgetState(ID, Position, State, ErrorOutput) Global SetGridGadgetState.SetGridGadgetState = GetFunction(PBEx_GridGadget, "SetGridGadgetState") Prototype SetGridGadgetItemState(ID, Position, Column, State, ErrorOutput) Global SetGridGadgetItemState.SetGridGadgetItemState = GetFunction(PBEx_GridGadget, "SetGridGadgetItemState") Prototype SetGridGadgetColor(ID, ColorType, Color, ErrorOutput) Global SetGridGadgetColor.SetGridGadgetColor = GetFunction(PBEx_GridGadget, "SetGridGadgetColor") Prototype GetGridGadgetColor(ID, ColorType, ErrorOutput) Global GetGridGadgetColor.GetGridGadgetColor = GetFunction(PBEx_GridGadget, "GetGridGadgetColor") Prototype SetGridGadgetItemColor(ID, Position, Column, ColorType, Color, ErrorOutput) Global SetGridGadgetItemColor.SetGridGadgetItemColor = GetFunction(PBEx_GridGadget, "SetGridGadgetItemColor") Prototype GetGridGadgetItemColor(ID, Position, Column, ColorType, ErrorOutput) Global GetGridGadgetItemColor.GetGridGadgetItemColor = GetFunction(PBEx_GridGadget, "GetGridGadgetItemColor") EndIf Global Output$ = Space(1024) Global ErrorOutput$ = Space(128) Global a If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) GridGadget(1, 0, 0, 500, 400, #PBEx_GridGadget_Flag_AllowAddRows | #PBEx_GridGadget_Flag_AllowDeleteRows | #PBEx_GridGadget_Flag_AutoColumnWidth | #PBEx_GridGadget_Flag_MultiSelect, WindowID(0), @ErrorOutput$) AddGridGadgetColumn(1, -1, 0, "Column 1", 100, @ErrorOutput$) AddGridGadgetColumn(1, -1, 0, "Column 2", 100, @ErrorOutput$) AddGridGadgetColumn(1, -1, 0, "Column 3", 100, @ErrorOutput$) For a=1 To 9 AddGridGadgetItem(1, -1, "Hello " + Str(a) + Chr(10) + "PureBasic " + Str(a) + Chr(10) + "Friends " + Str(a), @ErrorOutput$) Next Repeat Select WaitWindowEvent() Case #PB_Event_CloseWindow CloseLibrary(PBEx_GridGadget) End EndSelect ForEver EndIf ; IDE Options = PureBasic 5.60 (Windows - x64) ; CursorPosition = 15 ; EnableXP ; EnableUser ; Executable = PB.Ex_MSSQL.exe ; CompileSourceDirectory ; EnableCompileCount = 1323 ; EnableBuildCount = 7 ; EnableUnicode