It is currently Mon Sep 16, 2019 9:47 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 147 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next
Author Message
 Post subject: [Modules] ListEx (all OS / DPI)
PostPosted: Tue Mar 05, 2019 11:13 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 891
Location: Germany
ListEx Gadget - Module (all OS / DPI / 64Bit)

  • Gadget: #GridLines / #NoRowHeader / #NumberedColumn (= Column 0 with line numbers)
  • Support of images with/without text or for buttons
  • editable columns (Strings/CheckBoxes/ComboBoxes/DateGadgets)
  • Columns with events (Buttons / Links / Header-Click)
  • Sortable columns (String / Integer / Float / Date / Birthday / Time / Money)
  • Sorted according to German rules (encyclopedia or telephone book)
  • Sort by header click (#SortArrows / #SwitchDirection)
  • Automatically reduces the size of a defined column when the horizontal scroll bar becomes visible
  • Labels for columns for easier query
  • Data (Integer) and ID (String) can be specified for each list line
  • automatic size adjustment to window (#MoveX|#MoveY|#ResizeWidth|#ResizeHeight)

Image

Code:
; ListEx::AddItem()                 - similar to 'AddGadgetItem()'
; ListEx::AddColumn()               - similar to 'AddGadgetColumn()'
; ListEx::AddComboBoxItems()        - add items to the comboboxes of the column (items seperated by #LF$)
; ListEx::CountItems()              - similar to 'CountGadgetItems()'
; ListEx::ChangeCountrySettings()   - change default settings
; ListEx::ClearComboBoxItems()      - clear items of the comboboxes of the column
; ListEx::ClearItems()              - similar to 'ClearGadgetItems()'
; ListEx::DisableEditing()          - disable editing for the complete list
; ListEx::DisableReDraw()           - disable redraw
; ListEx::EventColumn()             - column of event (Event: ListEx::#Event_Module)
; ListEx::EventRow()                - row of event    (Event: ListEx::#Event_Module)
; ListEx::EventState()              - returns state   (e.g. CheckBox / DateGadget)
; ListEx::EventValue()              - returns value   (string)
; ListEx::EventID()                 - returns row ID or header label
; ListEx::Gadget()                  - [#GridLines|#NumberedColumn|#NoRowHeader]
; ListEx::GetAttribute()            - similar to 'GetGadgetAttribute()'
; ListEx::GetCellText()             - similar to 'GetGadgetItemText()' with labels
; ListEx::GetCellState()            - similar to 'GetGadgetItemState()' with labels
; ListEx::GetChangedState()         - check whether entries have been edited
; ListEx::GetColumnAttribute()      - similar to 'GetGadgetItemAttribute()'
; ListEx::GetColumnState()          - similar to 'GetGadgetItemState()' for a specific column
; ListEx::GetItemData()             - similar to 'GetGadgetItemData()'
; ListEx::GetItemID()               - similar to 'GetGadgetItemData()' but with string data
; ListEx::GetItemState()            - similar to 'GetGadgetItemState()'
; ListEx::GetItemText()             - similar to 'GetGadgetItemText()'
; ListEx::.GetState(GNum.i)         - similar to 'GetGadgetState()'
; ListEx::Refresh()                 - redraw gadget
; ListEx::RemoveColumn()            - similar to 'RemoveGadgetColumn()'
; ListEx::RemoveItem()              - similar to 'RemoveGadgetItem()'
; ListEx::ResetChangedState()       - reset to not edited
; ListEx::SetAutoResizeColumn()     - column that is reduced when the vertical scrollbar is displayed.
; ListEx::SetAutoResizeFlags()      - [#MoveX|#MoveY|#ResizeWidth|#ResizeHeight]
; ListEx::SetCellState()            - similar to 'SetGadgetItemState()' with labels
; ListEx::SetCellText()             - similar to 'SetGadgetItemText()' with labels
; ListEx::SetColor()                - similar to 'SetGadgetColor()'
; ListEx::SetColorTheme()           - change the color theme
; ListEx::SetColumnAttribute()      - [#Align/#Width/#Font]
; ListEx::SetColumnState()          - similar to 'SetGadgetItemState()' for a specific column
; ListEx::SetDateMask()             - similar to 'SetGadgetText()' and 'DateGadget()'
; ListEx::SetDateAttribute()        - similar to 'SetGadgetAttribute()' and 'DateGadget()'
; ListEx::SetFont()                 - similar to 'SetGadgetFont()'
; ListEx::SetHeaderAttribute()      - [#Align]
; ListEx::SetHeaderSort()           - enable sort by header column [#Sort_Ascending|#Sort_Descending|#Sort_NoCase|#Sort_SwitchDirection]
; ListEx::SetItemAttribute()        - similar to 'SetGadgetItemAttribute()'
; ListEx::SetItemColor()            - similar to 'SetGadgetItemColor()'
; ListEx::SetItemData()             - similar to 'SetGadgetItemData()'
; ListEx::SetItemFont()             - change font of row or header [#Header]
; ListEx::SetItemID()               - similar to 'SetGadgetItemData()' but with string data
; ListEx::SetItemImage( )           - add a image at row/column
; ListEx::SetItemState()            - similar to 'SetGadgetItemState()'
; ListEx::SetItemText()             - similar to 'SetGadgetItemText()'
; ListEx::SetProgressBarAttribute() - set minimum or maximum value for progress bars
; ListEx::SetProgressBarFlags()     - set flags for progressbar (#ShowPercent)
; ListEx::SetRowsHeight()           - change height of rows
; ListEx::SetTimeMask()             - change mask for time (sorting)
; ListEx::Sort()                    - sort rows by column [#SortString|#SortNumber|#SortFloat|#SortDate|#SortBirthday|#SortTime|#SortCash / #Deutsch]


Download: ListExModule.pbi

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Last edited by Thorsten1867 on Tue Aug 27, 2019 12:08 pm, edited 11 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (Beta)
PostPosted: Tue Mar 05, 2019 1:30 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 2:15 pm
Posts: 819
Location: Cuernavaca, Mexico
Thanks Thorsten.

I'm just in the beginning stages of coding a game that needs to maintain
a grid for player and game stats... this well laid-out List gadget will be a
welcome addition. :D

PS -No problems with Demo using Win 10 Pro (x64) and PB 5.70 (x86)

_________________
- It was too lonely at the top.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (Beta)
PostPosted: Tue Mar 05, 2019 5:32 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 891
Location: Germany
Added: Resize Handle with autoresize defined column (minWidth/maxWidth)

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (Beta)
PostPosted: Tue Mar 05, 2019 7:21 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3654
Location: Berlin, Germany
Very useful, many thanks for sharing!
Obviously, this was a lot of work.

One important information is missing in the first post here:
Source code wrote:
All OS
:-)

Much appreciated.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (all OS)
PostPosted: Tue Mar 05, 2019 7:51 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 891
Location: Germany
Added: Link with pop-up menu possible

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (all OS)
PostPosted: Wed Mar 06, 2019 7:14 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jun 23, 2014 1:18 pm
Posts: 107
Really nice Work. :D

But Can't use it, cause of DPI.

Image


(It's the Problem of ALL Canvas-Based Gadgets)


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (all OS)
PostPosted: Wed Mar 06, 2019 9:43 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 10524
Location: Beyond the pale...
Cyllceaux wrote:
...It's the Problem of ALL Canvas-Based Gadgets


I don't see that at all. Fonts are automatically scaled so it is just a case of using the current DPI scale factor alongside the available text metric functions to lay out the content appropriately. Aside from a lack of support for per-monitor DPI awareness, there are no real issues with the canvas gadget aside from having to put in a little more effort as PB cannot possibly scale all the content automatically. I have a substantial cross-platform grid control in development and it is behaving itself fine with regards DPI, although PB support for DPI awareness is somewhat limited right now.

@Thorsten : there seems to be massive flicker when dragging a horizontal scrollbar after I resize things to make the scrollbars visible. The client area seems to 'jump' about a bit. If you are editing a cell and move the vertical scrollbar, the string gadget can get left behind. Also, the various child controls occasionally overlay the scrollbars. All 'classic' problems when embedding child controls in a grid control - I should know as I had to contend with all of these problems with my original EsGRID control! :) Win 7x64, PB 5.70.

_________________
I may look like a mule, but I'm not a complete ass.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (all OS)
PostPosted: Wed Mar 06, 2019 3:11 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4502
Location: Lyon - France
Really usefull gadget missing in PB :shock:
Thanks a lot for sharing 8)

Do you think it's possible to use it a day, like VirtualListIcon for load very quickly thousand of lines ?
viewtopic.php?p=513256#p513256
The first problem surely is lost the "all OS" side :|

Code:
IncludeFile "ListExModule.pbi"

#Window  = 0

Enumeration 1
 #List
EndEnumeration

If OpenWindow(#Window, 0, 0, 500, 250, "Window", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
 
 HeureDebut = ElapsedMilliseconds()
 ListEx::Gadget(#List, 10, 10, 400, 230, "", 25, "", ListEx::#GridLines|ListEx::#NumberedColumn) ; ListEx::#NoRowHeader|ListEx::#NumberedColumn|ListEx::#CheckBoxes
 
 ListEx::AddColumn(#List, ListEx::#LastItem, "Lines",    275)
 ListEx::SetHeaderAttribute(#List, ListEx::#Align, ListEx::#Center)
 
 For i = 1 To 1000
  ListEx::AddItem(#List, ListEx::#LastItem, #LF$ + "Line number " + Trim(Str(i)))
 Next
 
 ListEx::SetRowsHeight(#List, 22)
 TempPasser$ = StrF((ElapsedMilliseconds() - HeureDebut) / 1000) + " secondes"
 MessageRequester("Time elapsed",  TempPasser$)
 
 Repeat
  Event = WaitWindowEvent()
 Until Event = #PB_Event_CloseWindow
 
EndIf

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (all OS)
PostPosted: Wed Mar 06, 2019 6:10 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 891
Location: Germany
  • Bugfixes
  • new flag: #SingleClickEdit

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (all OS)
PostPosted: Wed Mar 06, 2019 6:12 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 891
Location: Germany
Kwai chang caine wrote:
Do you think it's possible to use it a day, like VirtualListIcon for load very quickly thousand of lines ?
viewtopic.php?p=513256#p513256
The first problem surely is lost the "all OS" side :|


The reason for developing the module was that I needed a cross-platform solution.

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (all OS)
PostPosted: Wed Mar 06, 2019 6:46 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Jun 23, 2014 1:18 pm
Posts: 107
srod wrote:
Cyllceaux wrote:
...It's the Problem of ALL Canvas-Based Gadgets


I don't see that at all. Fonts are automatically scaled so it is just a case of using the current DPI scale factor alongside the available text metric functions to lay out the content appropriately. Aside from a lack of support for per-monitor DPI awareness, there are no real issues with the canvas gadget aside from having to put in a little more effort as PB cannot possibly scale all the content automatically. I have a substantial cross-platform grid control in development and it is behaving itself fine with regards DPI, although PB support for DPI awareness is somewhat limited right now.


I don't say it is a bug of Canvas... It is a Problem of Canvas-Based Gadgets.

If I multiply the inner-width with 1.5 (I use a Surface with a 150% dpi scale), than the gadget looks right. Simple problem, simple solution. :wink: :D


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (all OS)
PostPosted: Wed Mar 06, 2019 8:09 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 891
Location: Germany
  • nasty bug fixed
  • added support for 'Tab' & 'Shift-Tab' in editable fields

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (all OS)
PostPosted: Wed Mar 06, 2019 11:22 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1701
Location: Germany (Saxony, Deutscheinsiedel)
Very good work, and an impressive function-list... and cross-platform, thank you very much for sharing! :D

I still need to test it on MacOS... But on Win10 it works fine here, with one exception: there seems to a canvas drawing error, see the screenshot here: https://cdn1.imggmi.com/uploads/2019/3/ ... 7-full.jpg

Do you plan to make it working in Dialogs (with automatic resizing) too?
If not, it shouldn't be a big problem to use the List (canvas-gadget) as child of an (automatically) resizing container gadget, and react on the resize events... ;)

_________________
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (all OS)
PostPosted: Thu Mar 07, 2019 8:19 am 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4305
Location: Germany
Just tested your module: ThumpUp !!!

Then I took a look to avoid the json color files and found,
that in SetColor are some attributes missing.

HeaderFront.i
HeaderBack.i
HeaderGrid.i
ScrollBar.i

They are not inside. Please add these too.

Bernd


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] Editable and sortable ListGadget (all OS)
PostPosted: Thu Mar 07, 2019 9:22 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 10524
Location: Beyond the pale...
Still problems with horizontal scrolling. Problems also with combo cells. I am finding that when I edit one and then select another cell, the combo contents often disappear. Cannot reproduce this 100% consistently, though the following seems to do it most often : select the first combo cell and change contents to 'female'. Select another cell. Now double click the first combo cell again, do not change its contents and then double click another cell. The contents of the combo cell seem to be wiped.

_________________
I may look like a mule, but I'm not a complete ass.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 147 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye