[Module] GridExModule.pbi
Re: [Module] GridExModule.pbi
Issues:
1. Example 1 & 2:
Cell focus does not follow browsing the grid with arrow keys.
Must use a LMBClick to change focus?
2. Example 2:
[Home] key jumps to top cell of column, not left-most cell of row?
[Ctrl+Home] does jump to top left cell.
[Ctrl+End] does jump to bottom right cell.
3. Example 1:
Maybe not GridEx related and more the example code, but resizing the window is very quirky and blanks the grid and Import/Export buttons.
4. Example 1 & 2:
[Ctrl+LMBClick] selects an entire row.
Does not allow non-contiguous cell selections?
1. Example 1 & 2:
Cell focus does not follow browsing the grid with arrow keys.
Must use a LMBClick to change focus?
2. Example 2:
[Home] key jumps to top cell of column, not left-most cell of row?
[Ctrl+Home] does jump to top left cell.
[Ctrl+End] does jump to bottom right cell.
3. Example 1:
Maybe not GridEx related and more the example code, but resizing the window is very quirky and blanks the grid and Import/Export buttons.
4. Example 1 & 2:
[Ctrl+LMBClick] selects an entire row.
Does not allow non-contiguous cell selections?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] GridExModule.pbi
Update:
- Select rows by clicking on the header of the row with the CRTL & left mouse button.
- Select single cells with CRTL & left mouse click
- Home now jumps to the first column and end to the last column
Last edited by Thorsten1867 on Fri Nov 24, 2017 6:02 pm, edited 1 time in total.
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
When I use arrow keys to browse the grid, the row/col never updates to the current cell?
Line 3973: Debug "-> "+Str(Row)+" / "+Str(Col) ;<-- How to query current row/col after arrow keys?
Line 3973: Debug "-> "+Str(Row)+" / "+Str(Col) ;<-- How to query current row/col after arrow keys?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] GridExModule.pbi
Added: GetCurrentCell(GID.i, Flag.i) ; #Row / #Columnskywalk wrote:When I use arrow keys to browse the grid, the row/col never updates to the current cell?
Code: Select all
Line 8864: Debug GetCurrentCell(GID, #Column)
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]
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] GridExModule.pbi
Added: Save/Load grid as worksheet (including the used images)
The files with the data, the design and the current theme are stored in a ZIP container. Additionally used pictures are saved inside.
For testing I added a sample worksheet.
The files with the data, the design and the current theme are stored in a ZIP container. Additionally used pictures are saved inside.
For testing I added a sample worksheet.
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]
- Zebuddi123
- Enthusiast
- Posts: 794
- Joined: Wed Feb 01, 2012 3:30 pm
- Location: Nottinghamshire UK
- Contact:
Re: [Module] GridExModule.pbi
Hi Thorsten1867 Only the GridEx_Example.xgd file in the zip THanks for sharing
malleo, caput, bang. Ego, comprehendunt in tempore
Re: [Module] GridExModule.pbi
Using #PB_Any as the GadgetID doesn't seem to work.
Code: Select all
Enumeration
#Win
EndEnumeration
If OpenWindow(#Win, 0, 0, 800, 470, "GridEX - Gadget", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
Grid = GridEx::Gadget(#Win, #PB_Any, 10, 10, 470, 138, 6, 7, GridEx::#NoScrollBars)
GridEx::Hide(Grid, #True)
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
EndIf
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] GridExModule.pbi
Bug fixed!wombats wrote:Using #PB_Any as the GadgetID doesn't seem to work.
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
Works great now!Thorsten1867 wrote:Bug fixed!wombats wrote:Using #PB_Any as the GadgetID doesn't seem to work.
Is it possible to prevent the user from typing in a particular cell? I thought GridEx::#NoEdit might do the trick, but seemingly not.
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] GridExModule.pbi
Bug fixed!wombats wrote:Is it possible to prevent the user from typing in a particular cell? I thought GridEx::#NoEdit might do the trick, but seemingly not.
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
Thanks!Thorsten1867 wrote:Bug fixed!wombats wrote:Is it possible to prevent the user from typing in a particular cell? I thought GridEx::#NoEdit might do the trick, but seemingly not.
Is there a bug in GridEx::AddRow? It doesn't seem to be able to insert rows before existing rows.
If you have two GridEx controls, the second one loses its font if it is the same font name as the first. However, if you set it to a different font name to the first GridEx, it works.
Code: Select all
XIncludeFile("GridExModule.pbi")
Enumeration
#Win
EndEnumeration
If OpenWindow(#Win, 0, 0, 800, 470, "GridEX - Gadget", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
Grid1 = GridEx::Gadget(#Win, #PB_Any, 10, 10, 300, 250, 6, 7, GridEx::#NoScrollBars)
Grid2 = GridEx::Gadget(#Win, #PB_Any, 325, 10, 300, 250, 6, 7, GridEx::#NoScrollBars)
GridEx::SetFont(Grid1, "Verdana", 9)
GridEx::SetFont(Grid2, "Verdana", 9)
GridEx::Refresh(Grid1)
GridEx::Refresh(Grid2)
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
EndIf
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] GridExModule.pbi
I hope the bug is now fixed.
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
In the Free() procedure, it doesn't seem to free all of the gadgets created for the GridEx. I was having issues with the ContainerGadget being left behind. I changed the Free() procedure to the following and the issue went away.
Code: Select all
Procedure Free(GID.i)
If IsGadget(GID)
FreeGadget(GID)
If FindMapElement(Grid(), Str(GID))
If IsGadget(Grid()\GId\Canvas) : FreeGadget(Grid()\GId\Canvas) : EndIf
If IsGadget(Grid()\GId\HScroll) : FreeGadget(Grid()\GId\HScroll) : EndIf
If IsGadget(Grid()\GId\VScroll) : FreeGadget(Grid()\GId\VScroll) : EndIf
If IsGadget(Grid()\GId\String) : FreeGadget(Grid()\GId\String) : EndIf
If IsGadget(Grid()\GId\ListView) : FreeGadget(Grid()\GId\ListView) : EndIf
If IsGadget(Grid()\GId\Container) : FreeGadget(Grid()\GId\Container) : EndIf
EndIf
DeleteMapElement(Grid(), Str(GID))
EndIf
EndProcedure
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] GridExModule.pbi
Changed
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
Thanks for fixing the bugs I've mentioned so far!
I'm experiencing odd behaviour when adding rows. Sometimes when a row is added, the rows above it change position, and sometimes the new row isn't added where I expected it.
I've been using this to test, but each time it acts differently. I've noticed that if a new row is added as the first row, then sometimes it will move down one when rows are added below it.
I'm experiencing odd behaviour when adding rows. Sometimes when a row is added, the rows above it change position, and sometimes the new row isn't added where I expected it.
I've been using this to test, but each time it acts differently. I've noticed that if a new row is added as the first row, then sometimes it will move down one when rows are added below it.
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", 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, "Verdana", 9) : GridEx::Refresh(Grid1)
BindGadgetEvent(#Button1, @OnButtonClicked())
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
EndIf