[Module] GridExModule.pbi
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] GridExModule.pbi
Try this one.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Module] GridExModule.pbi
That seems to have fixed that. Thanks.
I'm not sure AddRow() is returning the right value. I assume it is supposed to return the number of the new row. Is that right? Can you check it, please? I'm afraid I don't really understand the code.
I'm not sure AddRow() is returning the right value. I assume it is supposed to return the number of the new row. Is that right? Can you check it, please? I'm afraid I don't really understand the code.
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] GridExModule.pbi
AddRow() returns the new number of rows.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Module] GridExModule.pbi
Ah, OK. Thanks for clarifying that.Thorsten1867 wrote:AddRow() returns the new number of rows.
Re: [Module] GridExModule.pbi
Please,
How much rows and cols can I add to the GridEx.
In my test I can add only 12 rows!!
Is that correct?
Thanks
How much rows and cols can I add to the GridEx.
In my test I can add only 12 rows!!
Is that correct?
Thanks
QuimV
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] GridExModule.pbi
Actually, the number of rows should not matter. Can you describe the problem in more detail?
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Module] GridExModule.pbi
This is my code:
Click button #Button1 more than 12 times, please
Max number of rows are 12
Code: Select all
XIncludeFile("GridExModule.pbi")
Enumeration
#Win
#Container
#Container2
#Button1
#Button2
EndEnumeration
Global Grid1
Procedure OnButtonClicked()
row = GridEx::GetAttribute(Grid1, GridEx::#Attrib_Row)
GridEx::AddRow(Grid1, "new" + #CRLF$ + "Column 2", row - 1)
GridEx::Refresh(Grid1)
EndProcedure
If OpenWindow(#Win, 0, 0, 800, 470, "GridEX - Gadget", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
ButtonGadget(#Button1, 350, 10, 100, 30, "Add Row")
Grid1 = GridEx::Gadget(#Win, #PB_Any, 10, 10, 300, 250, 6, 7, GridEx::#NoScrollBars)
GridEx::SetFont(Grid1, "Arial", 10) : GridEx::Refresh(Grid1)
BindGadgetEvent(#Button1, @OnButtonClicked())
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
EndIf
Max number of rows are 12
QuimV
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] GridExModule.pbi
I tested the code and could add over 30 lines.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Module] GridExModule.pbi
@Thorsten1867
My mistake is that I expected a vertical scroll bar to appear
Thanks
My mistake is that I expected a vertical scroll bar to appear
Thanks
QuimV
Re: [Module] GridExModule.pbi
When I press the up or down arrows, the selected cell loses focus.
If I press the left or right arrows, the focus is restored.
Is this correct?
I use a virtual machine windows 7 professional 32 bits and PB5.61
If I press the left or right arrows, the focus is restored.
Is this correct?
I use a virtual machine windows 7 professional 32 bits and PB5.61
QuimV
Re: [Module] GridExModule.pbi
I have noticed an unexpected result in the #Cash column.
In example 1 I entered value -2500000,65 and it displayed as -2.500.000,75.
PB function works as expected: FormatNumber(-2500000.65,2,",",".") = -2.500.000,65.
I work on financial software, #Cash columns with correct outcome are helpful
Is #Cash formatting reliable ?
Update:
Found it: in _FormatCell() replace ValF() with ValD() and everything works fine ...
In example 1 I entered value -2500000,65 and it displayed as -2.500.000,75.
PB function works as expected: FormatNumber(-2500000.65,2,",",".") = -2.500.000,65.
I work on financial software, #Cash columns with correct outcome are helpful
Is #Cash formatting reliable ?
Update:
Found it: in _FormatCell() replace ValF() with ValD() and everything works fine ...
-
- Enthusiast
- Posts: 732
- Joined: Fri Jul 14, 2006 8:53 pm
- Location: Malta
- Contact:
Re: [Module] GridExModule.pbi
Really well done
I may not help with your coding
Just ask about mental issues!
http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
Just ask about mental issues!
http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
Re: [Module] GridExModule.pbi
When right-clicking on the grid, it cancels the selection. Is there a way to change that? If a popup menu is opened, the user will be expecting the selected item to affect the selection they made. If that selection is cancelled, the popup menu won't do as they expect.
Also, what's the best way to get the currently selected row(s)? I do the following, but when multiple rows are selected, it always returns those rows as the selection, and it doesn't allow for single selection.Finally, when the grid has only a single column, and it is longer than the width of the gadget, the scrollbar doesn't adjust so the user can see the rest of the cell.
Also, what's the best way to get the currently selected row(s)? I do the following, but when multiple rows are selected, it always returns those rows as the selection, and it doesn't allow for single selection.
Code: Select all
GridEx::GetSelection(*grid)
firstRow = GridEx::Area\Row\First
lastRow = GridEx::Area\Row\Last
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: [Module] GridExModule.pbi
I am trying to use the GridEx module to display a lengthy dataset in 200 row chunks. Number of rows in Gridex set to 200
I set the Vscroll maximum to the number of rows in the dataset.
After clicking the VScroll it counts up to 182 but no further. I can get the next 200 records by adding up the number of offsets used but the VSCroll value returned by
Debug GetGadgetState(gridex::GetAttribute(DBGrid,Gridex::#Attrib_GadgetRowScroll)) never climbs above the 182. It appears tied to the number of rows in the grid.
I would prefer to use the gadget state to select the next 200 records.
Can I get over this?
Regards
CD
I set the Vscroll maximum to the number of rows in the dataset.
After clicking the VScroll it counts up to 182 but no further. I can get the next 200 records by adding up the number of offsets used but the VSCroll value returned by
Debug GetGadgetState(gridex::GetAttribute(DBGrid,Gridex::#Attrib_GadgetRowScroll)) never climbs above the 182. It appears tied to the number of rows in the grid.
I would prefer to use the gadget state to select the next 200 records.
Can I get over this?
Regards
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: [Module] GridExModule.pbi
Got over the problem by creating the grid with no scroll bars and adding my own to the side.
Works a treat now.
Works a treat now.
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.