With this library you can create a GridGadget like you know it in .NET Forms.
Screenshot:
Functions:
- GridGadget()
- Syntax:
Code: Select all
Result = GridGadget(ID, X, Y, Width, Height, Flags, ParentWindowID, @ErrorOutput$)
- Description: Creates a new GridGadget.
- Parameter:
- ID: A unique number. #PB_Any can be used to generate the number automatically.
- X: The position of the gadget on the window.
- Y: The position of the gadget on the window.
- Width: The width of the gedget on the window.
- Height: The height of the gedget on the window.
- Flags: The following constants can be used:
- #PBEx_GridGadget_Flag_AllowAddRows
- #PBEx_GridGadget_Flag_AllowDeleteRows
- #PBEx_GridGadget_Flag_AllowOrderColumns
- #PBEx_GridGadget_Flag_AllowResizeColumns
- #PBEx_GridGadget_Flag_AllowResizeRows
- #PBEx_GridGadget_Flag_AllowResizeColumnHeight
- #PBEx_GridGadget_Flag_AllowResizeRowWidth
- #PBEx_GridGadget_Flag_HideColumnHeader
- #PBEx_GridGadget_Flag_HideRowHeader
- #PBEx_GridGadget_Flag_MultiSelect
- #PBEx_GridGadget_Flag_ReadOnly
- #PBEx_GridGadget_Flag_AutoColumnWidth
- ParentWindowID: The ID of the window on which the gadget is to be created. The ID of the window can be determined with WindowID().
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful. If #PB_Any is used, the ID is returned.
- Beispielcode:
Code: Select all
;1.0.1.0 EnableExplicit Global PBEx_GridGadget #PBEx_GridGadget_Version$ = "1.0.1.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 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") 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
- Syntax:
Code: Select all
Result = AddGridGadgetColumn(ID, Position, Type, Text$, Width, @ErrorOutput$)
- Description: Adds a new column.
- Parameter:
- ID: The number of the gadget.
- Position: Defines the position that is ascending. The value "-1" can be used to always add the column at the end.
- Type: Defines the type of the column. The following constants can be used:
- #PBEx_GridGadget_Type_Text
- #PBEx_GridGadget_Type_Date
- #PBEx_GridGadget_Type_Lowercase
- #PBEx_GridGadget_Type_Uppercase
- #PBEx_GridGadget_Type_Percent
- Text$: The heading of the column.
- Width: The width of the column. If #PBEx_GridGadget_Flag_AutoColumnWidth is used, this parameter is ignored. #PBEx_GridGadget_ColumnWidth_AutoColumnWidth can be used to automatically adjust the column width to the available width.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = RemoveGridGadgetColumn(ID, Position, @ErrorOutput$)
- Description: Removes an existing column. After deletion, all cell values in this column are also removed.
- Parameter:
- ID: The number of the gadget.
- Position: The position of the column.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = AddGridGadgetItem(ID, Position, Text$, @ErrorOutput$)
- Description: Adds a new line.
- Parameter:
- ID: The number of the gadget.
- Position: Defines the position that is ascending. The value "-1" can be used to always add the line at the end.
- Text$: The text for the first cell. Chr(10) can be used to insert texts for other cells.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = RemoveGridGadgetItem(ID, Position, @ErrorOutput$)
- Description: Removes an existing row. All cell values of this row are also deleted.
- Parameter:
- ID: The number of the gadget.
- Position: The position of the line.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = CountGridGadgetColumns(ID, @ErrorOutput$)
- Description: Determines the number of columns.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value: Number of columns.
- Syntax:
Code: Select all
Result = CountGridGadgetItems(ID, @ErrorOutput$)
- Description: Determines the number of rows.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value: Number of rows.
- Syntax:
Code: Select all
Result = ClearGridGadgetColumns(ID, @ErrorOutput$)
- Description: Removes all columns. All rows are also deleted.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = ClearGridGadgetItems(ID, @ErrorOutput$)
- Description: Removes all rows.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = GetGridGadgetColumnText(ID, Position, @Output$, @ErrorOutput$)
- Description: Determines the heading of a column.
- Parameter:
- ID: The number of the gadget.
- Position: The position of the column.
- @Output$: The column heading is stored in this variable. If 0 was passed, the length is returned as the return value.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = SetGridGadgetColumnText(ID, Position, Text$, @ErrorOutput$)
- Description: Changes the heading of a column.
- Parameter:
- ID: The number of the gadget.
- Position: The position of the column.
- Text$: The new heading of the column.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = GetGridGadgetItemText(ID, Position, Column, @Output$, @ErrorOutput$)
- Description: Determines the contents of a cell.
- Parameter:
- ID: The number of the gadget.
- Position: The position of the line.
- Column: The position of the column.
- @Output$: The contents of the cell are stored in this variable. If 0 was passed, the length is returned as the return value.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = SetGridGadgetItemText(ID, Position, Column, Text$, @ErrorOutput$)
- Description: Changes the contents of a cell.
- Parameter:
- ID: The number of the gadget.
- Position: The position of the line.
- Column: The position of the column.
- Text$: The new contents of the cell.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = FreeGridGadget(ID, @ErrorOutput$)
- Description: Free the gadget.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = GridGadgetWidth(ID, @ErrorOutput$)
- Description: Determines the width of the gadget.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value: The width of the gadget.
- Syntax:
Code: Select all
Result = GridGadgetWidth(ID, @ErrorOutput$)
- Description: Determines the height of the gadget.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value: The height of the gadget.
- Syntax:
Code: Select all
Result = GridGadgetX(ID, @ErrorOutput$)
- Description: Determines the position of the gadget.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value: The position of the gadget.
- Syntax:
Code: Select all
Result = GridGadgetY(ID, @ErrorOutput$)
- Description: Determines the position of the gadget.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value: The position of the gadget.
- Syntax:
Code: Select all
Result = GridGadgetID(ID, @ErrorOutput$)
- Description: Determines the handle number of the gadget.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value: The handle number of the gadget.
- Syntax:
Code: Select all
Result = HideGridGadget(ID, State, @ErrorOutput$)
- Description: Hides or displays the gadget.
- Parameter:
- ID: The number of the gadget.
- State:
- 0: Displays the gadget.
- 1: Hide the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = IsGridGadget(ID, @ErrorOutput$)
- Description: Checks if the gadget is valid.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The gadget is valid.
- Syntax:
Code: Select all
Result = ResizeGridGadget(ID, X, Y, Width, Height, @ErrorOutput$)
- Description: Changes the position and size of the gadget.
- Parameter:
- ID: The number of the gadget.
- X: The new position of the gadget. #PB_Ignore can be used not to change this value.
- Y: The new position of the gadget. #PB_Ignore can be used not to change this value.
- Width: The new height of the gadget. #PB_Ignore can be used not to change this value.
- Height: The new width of the gadget. #PB_Ignore can be used not to change this value.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = SortGridGadgetColumn(ID, Column, Direction, @ErrorOutput$)
- Description: Sorts a column.
- Parameter:
- ID: The number of the gadget.
- Column: The position of the column.
- Direction: The following constants can be used:
- #PBEx_GridGadget_Direction_Ascending
- #PBEx_GridGadget_Direction_Descending
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum return length is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = DisableGridGadget(ID, State, @ErrorOutput$)
- Description: Enables or disables the gadget.
- Parameter:
- ID: The number of the gadget.
- State:
- 0: Gadget is activated.
- 1: Gadget is deactivated.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = SetGridGadgetAttribute(ID, Attribute, Value, @ErrorOutput$)
- Description: Changes a setting using the attribute.
- Parameter:
- ID: The number of the gadget.
- Attribute: The following constants can be used:
- #PBEx_GridGadget_Attribute_SelectType
- Value: The following constants can be used:
- #PBEx_GridGadget_Attribute_SelectType:
- #PBEx_GridGadget_Attribute_SelectType_CellSelect: Only individual cells can be selected, not entire rows.
- #PBEx_GridGadget_Attribute_SelectType_FullRowSelect: Only whole lines can be selected.
- #PBEx_GridGadget_Attribute_SelectType_RowHeaderSelect: Individual cells and entire rows can be selected.
- #PBEx_GridGadget_Attribute_SelectType:
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = GetGridGadgetAttribute(ID, Attribute, @ErrorOutput$)
- Description: Determines the value of the setting using the attribute.
- Parameter:
- ID: The number of the gadget.
- Attribute: The following constants can be used:
- #PBEx_GridGadget_Attribute_SelectType
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- #PBEx_GridGadget_Attribute_SelectType:
- #PBEx_GridGadget_Attribute_SelectType_CellSelect: Only individual cells can be selected, not entire rows.
- #PBEx_GridGadget_Attribute_SelectType_FullRowSelect: Only whole lines can be selected.
- #PBEx_GridGadget_Attribute_SelectType_RowHeaderSelect: Individual cells and entire rows can be selected.
- #PBEx_GridGadget_Attribute_SelectType:
- Syntax:
Code: Select all
Result = GetGridGadgetState(ID, @ErrorOutput$)
- Description: Determines the position of the first selected line.
- Parameter:
- ID: The number of the gadget.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value: The position of the first selected row.
- Syntax:
Code: Select all
Result = GetGridGadgetItemState(ID, Position, Column, @ErrorOutput$)
- Description: Checks whether the specified cell is selected.
- Parameter:
- ID: The number of the gadget.
- Position: The position of the line.
- Column: The position of the column.
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The cell is selected.
- Syntax:
Code: Select all
Result = SetGridGadgetState(ID, Position, State, @ErrorOutput$)
- Description: Selects the specified line.
- Parameter:
- ID: The number of the gadget.
- Position: The position of the line.
- State:
- 0: Cancels the selection.
- 1: Select
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = SetGridGadgetItemState(ID, Position, Column, State, @ErrorOutput$)
- Description: Selects the specified cell.
- Parameter:
- ID: The number of the gadget.
- Position: The position of the line.
- Column: The position of the column.
- State:
- 0: Cancels the selection.
- 1: Select
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The cell is selected.
- Syntax:
Code: Select all
Result = SetGridGadgetColor(ID, ColorType, Color, @ErrorOutput$)
- Description: Changes the color of the gadget.
- Parameter:
- ID: The number of the gadget.
- ColorType: The following constants can be used:
- #PBEx_GridGadget_ColorType_FrontColor
- #PBEx_GridGadget_ColorType_BackColor
- Color: The color that can be set with RGB().
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = GetGridGadgetColor(ID, ColorType, @ErrorOutput$)
- Description: Determines the color of the gadget.
- Parameter:
- ID: The number of the gadget.
- ColorType: The following constants can be used:
- #PBEx_GridGadget_ColorType_FrontColor
- #PBEx_GridGadget_ColorType_BackColor
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value: RGB color
- Syntax:
Code: Select all
Result = SetGridGadgetItemColor(ID, Position, Column, ColorType, Color, @ErrorOutput$)
- Description: Changes the color of the gadget.
- Parameter:
- ID: The number of the gadget.
- Position: The position of the line.
- Column: The position of the column.
- ColorType: The following constants can be used:
- #PBEx_GridGadget_ColorType_FrontColor
- #PBEx_GridGadget_ColorType_BackColor
- Color: The color that can be set with RGB().
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value:
- 1: The process was successful.
- Syntax:
Code: Select all
Result = GetGridGadgetItemColor(ID, Position, Column, ColorType, @ErrorOutput$)
- Description: Determines the color of the gadget.
- Parameter:
- ID: The number of the gadget.
- Position: The position of the line.
- Column: The position of the column.
- ColorType: The following constants can be used:
- #PBEx_GridGadget_ColorType_FrontColor
- #PBEx_GridGadget_ColorType_BackColor
- @ErrorOutput$: If an error occurred, the error message is stored in the variable. This variable must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character. If no error description is to be returned for an error, 0 can be passed instead.
- Return value: RGB color
- Syntax:
- Windows Vista or higher
- .NET Framework 4.5 or higher
- Unicode activation (default from PB 5.50)
Download: https://www.rsbasic.de/downloads/downlo ... Gadget.zip
I would be very pleased about feedbacks, improvement suggestions, error messages or wishes. If you want to support me, you can also donate something. Thanks