[Modules] ListEx (all OS / DPI)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Everything
Enthusiast
Enthusiast
Posts: 225
Joined: Sat Jul 07, 2018 6:50 pm

Re: [Modules] ListEx (all OS / DPI)

Post by Everything »

Now it works like a charm 8)
Thx.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: [Modules] ListEx (all OS / DPI)

Post by davido »

@Thorsten1867,
Do you know if it is possible to setup Drag/Drop on:
Rows or Columns or even Cells (single or multiple)?
DE AA EB
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Modules] ListEx (all OS / DPI)

Post by Thorsten1867 »

I don't have much experience with Drag & Drop yet, but it should be possible. With EventDropX() and EventDropY() it should be possible to determine the row or column.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: [Modules] ListEx (all OS / DPI)

Post by davido »

@Thorsten1867,
Thank you, very much, for your rapid and very helpful response.
I have checked your suggestion and it appears to work. :D

I apologise for not having taken enough care to find this in the manual. :oops:
DE AA EB
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Modules] ListEx (all OS / DPI)

Post by Thorsten1867 »

Update: Drag & Drop for editable cells (text)
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: [Modules] ListEx (all OS / DPI)

Post by davido »

@Thorsten1867,

An unexpected gift! Thank you. :D
Works fine for me.
You've made it so easy to set-up. Brilliant!
DE AA EB
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Modules] ListEx (all OS / DPI)

Post by Thorsten1867 »

Update:
  • Bugfix: Font
  • Drag & Drop: Insert a space if the cell already contains text.
@davido
Sounded like a good idea, which could be integrated without much effort.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Re: [Modules] ListEx (all OS / DPI)

Post by Cyllceaux »

some HARD-Performance-Tweaks for FitColumn

In AddItem

Code: Select all

   If ListEx()\FitCols : FitColumns_() : EndIf
To

Code: Select all

If ListEx()\ReDraw
   If ListEx()\FitCols : FitColumns_() : EndIf
   UpdateRowY_()
   Draw_()
EndIf
In DisableReDraw

Code: Select all

Else
    ListEx()\ReDraw = #True
    If ListEx()\FitCols : FitColumns_() : EndIf
    UpdateRowY_()
    UpdateColumnX_()
    Draw_()
EndIf
SetItemText (on both positions)

Code: Select all

If ListEx()\ReDraw 
    If ListEx()\Cols()\Flags & #FitColumn : FitColumns_() : EndIf
    Draw_() 
EndIf
Last edited by Cyllceaux on Sun Oct 20, 2019 8:25 pm, edited 1 time in total.
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Re: [Modules] ListEx (all OS / DPI)

Post by Cyllceaux »

Another Question...

How to set #FitColumn for Column 0?
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Re: [Modules] ListEx (all OS / DPI)

Post by Cyllceaux »

fond this :)
#Enable_ProgressBar = #False

Code: Select all

CompilerIf #Enable_ProgressBar
  Declare   SetProgressBarAttribute(GNum.i, Attrib.i, Value.i)
  Declare   SetProgressBarFlags(GNum.i, Flags.i)
CompilerEndIf
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Re: [Modules] ListEx (all OS / DPI)

Post by Cyllceaux »

_SynchronizeScrollCols()

Code: Select all

If ScrollPos < ListEx()\Col\OffsetX
    ListEx()\Col\OffsetX = ScrollPos; - dpiX(20)
ElseIf ScrollPos > ListEx()\Col\OffsetX
    ListEx()\Col\OffsetX = ScrollPos; + dpiX(20)
EndIf
After I changed this... it's not flickering anymore
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Re: [Modules] ListEx (all OS / DPI)

Post by Cyllceaux »

Oh... I have an EditGadget and a ListEx in the same window.

The ListEx takes the Returnkey so there is no Linebreak in the EditorGadget. :(
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Modules] ListEx (all OS / DPI)

Post by Thorsten1867 »

See if it works now.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Re: [Modules] ListEx (all OS / DPI)

Post by Cyllceaux »

Thorsten1867 wrote:See if it works now.
The EditorGadget workes fine :)
thx
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Re: [Modules] ListEx (all OS / DPI)

Post by kinglestat »

First of all, I quite like your grid. I am a heavy grid user!
I have 4 questions

Q1 is it possible to have rows of different sizes?
Q2 Is it possible to have only certain cells editable? For example only 1 cell in a whole grid
Q3 Is it possible to have a individual/different types in same column? For example column 2 row 1 string, column 2 row 2 combobox etc
Q4 If there is an image + edit/string in cell, is it possible to detect image click?
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
Post Reply