[Module] GridExModule.pbi

Share your advanced PureBasic knowledge/code with the community.
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: [Module] GridExModule.pbi

Post by Lord »

USCode wrote:...
Using PB 5.61 x64, getting an "Invalid memory access" error on line 5603:

Code: Select all

Grid(gid$)\Rows(r)\Height = Size\Rows(r)
Me too on Win7 x64 with PB5.60 x64.

Edit:
Change (starting at line 6369)

Code: Select all

    If FileSize("GridEx.win")
      GridEx::LoadGridSize(#Grid, "GridEx.win", GridEx::#Window|GridEx::#Grid)
    EndIf
to

Code: Select all

    If FileSize("GridEx.win")>0
      GridEx::LoadGridSize(#Grid, "GridEx.win", GridEx::#Window|GridEx::#Grid)
    EndIf
and it works, because there is no GridEx.win at first run.
Image
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] GridExModule.pbi

Post by Thorsten1867 »

Fixed

Added: Sort arrows for column header
Added: Editable ComboBox (enter text or select from list)
Added: CellTyp automatically sets appropriate formatting
Added: Image as cell content
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: [Module] GridExModule.pbi

Post by Kwai chang caine »

Added: CellTyp automatically sets appropriate formatting
Added: Image as cell content
Thanks a lot 8)
ImageThe happiness is a road...
Not a destination
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] GridExModule.pbi

Post by Thorsten1867 »

Added: Additional different colored lines (e.g. for calculation row)
Changed: Optical improvements (e.g. FocusBorder & Default colors)

Added: Checking the validity of entries for editable cells (#Integer/#Float/#Date/#Time/#Cash)

Update: a lot of Bugfixes
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
said
Enthusiast
Enthusiast
Posts: 342
Joined: Thu Apr 14, 2011 6:07 pm

Re: [Module] GridExModule.pbi

Post by said »

A new important update with bug fixes of MyGrid is available ...

Said
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] GridExModule.pbi

Post by Thorsten1867 »

Changed: Completely new event management
Added: Additional colored frames for single cells
Added: GetSelection(), to use selected cells for external procedures (e.g. merge cells)
Added: Copy selected cells to/from ClipBoard (CSV or Tabulator)
Added: Allow or forbid to change the size of the column and row (whole grid or single rows and columns).
Added: Themes for grid (e.g. header colors ...)
Added: Accept only valid entries for editable cells (#Valid)
Added: Cell type grades (DE/AT/GB/US/FR/ES/IT)
Added: Update calculations if a cell has been edited with the #Update flag

Some features available via pop-up menu for testing.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Module] GridExModule.pbi

Post by skywalk »

Example 2 and hit [PageDown] wrote:[13:53:07] Waiting for executable to start...
[13:53:07] Executable type: Windows - x64 (64bit, Unicode, Thread)
[13:53:07] Executable started.
[13:53:41] [ERROR] GridExModule.pbi (Line: 1742)
[13:53:41] [ERROR] SelectElement(): SelectElement(): index value can not be negative.
[PageUp] works?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Module] GridExModule.pbi

Post by skywalk »

Issues:
1. If I LeftClick the top left grid header, it sorts according to Column 1.
Normally, that = select all cells?
Where to call SelectAll(GID)? Line 6720 seems possible, but need to query GridEx for top left grid.

Code: Select all

        Case #PB_EventType_LeftButtonDown  ;{ LeftButtonDown
          X  = GetGadgetAttribute(Grid()\CanvasID, #PB_Canvas_MouseX)
          Y  = GetGadgetAttribute(Grid()\CanvasID, #PB_Canvas_MouseY)
          ColArea = _AreaCol_Of_X(GID, X)
          RowArea = _AreaRow_Of_Y(GID, Y)
          Grid()\Mouse\DownX = X
          Grid()\Mouse\DownY = Y
          Grid()\Mouse\DownAreaRow = RowArea
          Grid()\Mouse\DownAreaCol = ColArea
          If RowArea > 0 And ColArea > 0
            RemoveSelection(GID)
            SelectElement(Grid()\Row\AreaList(), RowArea)
            SelectElement(Grid()\Col\AreaList(), ColArea)
            ShowCell(GID, Grid()\Row\AreaList()\AreaRow, Grid()\Col\AreaList()\AreaCol, #True)
          Else
            SelectAll(GID)  ;<-- This needs additional filter for ONLY top left header click?
          EndIf ;}

2.
Example 1 and resize window width to a minimum. wrote:[14:03:02] Waiting for executable to start...
[14:03:02] Executable type: Windows - x64 (64bit, Unicode, Thread)
[14:03:02] Executable started.
[14:04:42] [ERROR] GridExModule.pbi (Line: 3120)
[14:04:42] [ERROR] The list doesn't have a current element.
[14:04:49] [ERROR] GridExModule.pbi (Line: 3120)
[14:04:49] [ERROR] Invalid memory access. (read error at address 18446744073709551615)
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] GridExModule.pbi

Post by Thorsten1867 »

skywalk wrote:
Example 2 and hit [PageDown] wrote:[13:53:07] Waiting for executable to start...
[13:53:07] Executable type: Windows - x64 (64bit, Unicode, Thread)
[13:53:07] Executable started.
[13:53:41] [ERROR] GridExModule.pbi (Line: 1742)
[13:53:41] [ERROR] SelectElement(): SelectElement(): index value can not be negative.
[PageUp] works?
Fixed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] GridExModule.pbi

Post by Thorsten1867 »

skywalk wrote:Issues:
1. If I LeftClick the top left grid header, it sorts according to Column 1.
Normally, that = select all cells?
Changed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
wombats
Enthusiast
Enthusiast
Posts: 663
Joined: Thu Dec 29, 2011 5:03 pm

Re: [Module] GridExModule.pbi

Post by wombats »

This is really great!

Is it possible to put images in the header cells? It doesn't seem to work.

Can it show the resizing of columns as the user resizes them?
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] GridExModule.pbi

Post by Thorsten1867 »

wombats wrote:This is really great!

Is it possible to put images in the header cells? It doesn't seem to work.

Can it show the resizing of columns as the user resizes them?
I'm working on it.

Gesendet von meinem KFSUWI mit Tapatalk
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Module] GridExModule.pbi

Post by skywalk »

Another item that would bring GridEx closer to Spreadsheet functionality is the ability to select non-contiguous rows and columns using [Ctrl]+LMBClick.
Examples:
User selects Col1 and Col3 and copies only their contents to clipboard or exports them to csv.
User selects Row1 and Row5 and copies only their contents to clipboard or exports them to csv.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] GridExModule.pbi

Post by Thorsten1867 »

Added: Mouse click in the left upper corner to select all cells
Added: Ctrl - Mouse click / Shift - Mouse click to select rows => Copy & Paste selected rows
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Module] GridExModule.pbi

Post by skywalk »

Cool, Google Drive link up to date, but Box = ; Last Update: 11.11.2017?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Post Reply