It is currently Thu Sep 19, 2019 3:25 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 150 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10
Author Message
 Post subject: Re: [Modules] ListEx (all OS / DPI)
PostPosted: Sun Aug 25, 2019 7:54 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
You need ListEx with "Last Update: 23.08.2019"

_________________
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] ListEx (all OS / DPI)
PostPosted: Fri Aug 30, 2019 7:56 am 
Offline
Addict
Addict

Joined: Fri Nov 09, 2012 11:04 pm
Posts: 1671
Location: Uttoxeter, UK
@Thorsten1867,
When a row is clicked, that row is highlighted in light blue colour.
Is it possible to change this colour?

_________________
DE AA EB


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] ListEx (all OS / DPI)
PostPosted: Fri Aug 30, 2019 10:16 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
davido wrote:
@Thorsten1867,
When a row is clicked, that row is highlighted in light blue colour.
Is it possible to change this colour?

You can change almost all colors and then save your own theme:
Code:
 SetColor(#List, #FocusColor, Color)

_________________
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] ListEx (all OS / DPI)
PostPosted: Fri Aug 30, 2019 7:22 pm 
Offline
Addict
Addict

Joined: Fri Nov 09, 2012 11:04 pm
Posts: 1671
Location: Uttoxeter, UK
@Thorsten1867,
Thank you, very much for your help. Excellent. :D

It always looks easy when one is shown how. :oops:

_________________
DE AA EB


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] ListEx (all OS / DPI)
PostPosted: Tue Sep 03, 2019 12:03 pm 
Offline
User
User

Joined: Sun Aug 02, 2015 7:17 pm
Posts: 19
1. When using ListEx::AddItem() to add a large number of items, then clear with ListEx::ClearItems()

When you add a small number of items again, various problems occur: the items disappear, and the scrollbars are in the wrong position.

2. The scroll bar position is not updated to the correct position when using ListEx::DisableReDraw()

In addition to the support for HIDPI, there is a slight deviation in the position of the edit box, which is the cause of purebasic itself, and Fred seems unwilling to fix it:
viewtopic.php?f=4&t=71879


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] ListEx (all OS / DPI)
PostPosted: Tue Sep 03, 2019 12:20 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
Please try:

Code:
 Procedure   ClearItems(GNum.i)
   
    If FindMapElement(ListEx(), Str(GNum))
      ClearList(ListEx()\Rows())
      Draw_()
    EndIf
   
  EndProcedure

Does it work then?

_________________
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] ListEx (all OS / DPI)
PostPosted: Tue Sep 03, 2019 1:44 pm 
Offline
User
User

Joined: Sun Aug 02, 2015 7:17 pm
Posts: 19
Thorsten1867 wrote:
Please try:

Code:
 Procedure   ClearItems(GNum.i)
   
    If FindMapElement(ListEx(), Str(GNum))
      ClearList(ListEx()\Rows())
      Draw_()
    EndIf
   
  EndProcedure

Does it work then?


Can't solve the problem

The problem may be that ListEx()\Row\Number, ListEx()\VScroll, ListEx()\HScroll, ClearItems haven't been updated since I tried


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] ListEx (all OS / DPI)
PostPosted: Tue Sep 03, 2019 1:59 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
Second try:

Code:
  Procedure   ClearItems(GNum.i)
   
    If FindMapElement(ListEx(), Str(GNum))
     
      ClearList(ListEx()\Rows())
     
      ListEx()\Row\Number = 0
      UpdateRowY_()
      AdjustScrollBars_()
     
      Draw_()
    EndIf
   
  EndProcedure

_________________
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] ListEx (all OS / DPI)
PostPosted: Tue Sep 03, 2019 2:55 pm 
Offline
User
User

Joined: Sun Aug 02, 2015 7:17 pm
Posts: 19
Thorsten1867 wrote:
Second try:

Code:
  Procedure   ClearItems(GNum.i)
   
    If FindMapElement(ListEx(), Str(GNum))
     
      ClearList(ListEx()\Rows())
     
      ListEx()\Row\Number = 0
      UpdateRowY_()
      AdjustScrollBars_()
     
      Draw_()
    EndIf
   
  EndProcedure


It can't solve the problem.

Only in this way can we solve the problem:

Code:
  Procedure   ClearItems(GNum.i)
   
    If FindMapElement(ListEx(), Str(GNum))
     
      ClearList(ListEx()\Rows())
   
      ListEx()\Row\Number = 0
      UpdateRowY_()
     
      SetGadgetAttribute(ListEx()\VScrollNum, #PB_ScrollBar_Minimum, 0)
      SetGadgetAttribute(ListEx()\VScrollNum, #PB_ScrollBar_Maximum, 0)
      SetGadgetAttribute(ListEx()\VScrollNum, #PB_ScrollBar_PageLength, 0)

      Draw_()
    EndIf
   
  EndProcedure


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] ListEx (all OS / DPI)
PostPosted: Tue Sep 03, 2019 4:57 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
Bugfixes

_________________
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] ListEx (all OS / DPI)
PostPosted: Wed Sep 11, 2019 8:44 am 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4308
Location: Germany
Hi Thorsten,

2 Problems:

1. If you do some right clicks inside the gadget an error with 'negative index not allwed' appears in _RightClickHandler()
Code:
IncludeFile "../pbi/ListExModule.pbi"

OpenWindow(0, 100, 100, 300, 120, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

ListEx::Gadget(0, 5, 5, 290, 90, "Test", 50, "", ListEx::#GridLines, 0)

Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow




2. Menu problem

is it possible that already a popup menu (0) is available, even if I not define one with ListEx::AttachPopupMenu() ?

Because if already a menue with id 0 is defined, something opens by right click on an item in your gadget.
If you move the mouse above you see the menu of the window.
Code:
IncludeFile "../pbi/ListExModule.pbi"

OpenWindow(0, 100, 100, 300, 120, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

CreateMenu(0, WindowID(0))
MenuTitle("Test")
MenuItem(0, "Item")

ListEx::Gadget(0, 5, 5, 290, 90, "Test", 50, "", ListEx::#GridLines, 0)
ListEx::AddItem(0, ListEx::#LastItem, "Amelia")

Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow


A bugfix is to add:
Code:
ListEx::AttachPopupMenu(0, -1)

Like
Code:
IncludeFile "../pbi/ListExModule.pbi"

OpenWindow(0, 100, 100, 300, 120, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

CreateMenu(0, WindowID(0))
MenuTitle("Test")
MenuItem(0, "Item")

ListEx::Gadget(0, 5, 5, 290, 90, "Test", 50, "", ListEx::#GridLines, 0)
ListEx::AddItem(0, ListEx::#LastItem, "Amelia")

ListEx::AttachPopupMenu(0, -1)

Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] ListEx (all OS / DPI)
PostPosted: Wed Sep 11, 2019 2:32 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
Bugfixes

_________________
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] ListEx (all OS / DPI)
PostPosted: Tue Sep 17, 2019 9:33 am 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4308
Location: Germany
Hi Thorsten,

next bug to fix:
Code:
IncludeFile "../pbi/ListExModule.pbi"

OpenWindow(0, 100, 100, 300, 120, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

ListEx::Gadget(0, 5, 5, 290, 90, "Test", 50, "", ListEx::#GridLines|ListEx::#MultiSelect, 0)
ListEx::AddItem(0, ListEx::#LastItem, "Line 1")
ListEx::AddItem(0, ListEx::#LastItem, "Line 2")
ListEx::AddItem(0, ListEx::#LastItem, "Line 3")
ListEx::AddItem(0, ListEx::#LastItem, "Line 4")
ListEx::AddItem(0, ListEx::#LastItem, "Line 5")



Repeat
  Event = WaitWindowEvent()
 
  Select Event
    Case #PB_Event_Gadget
      Select EventGadget()
        Case 0
          Select EventType()
            Case #PB_EventType_LeftClick
              Debug ListEx::CountItems(0, ListEx::#Selected)
          EndSelect
      EndSelect
     
  EndSelect
 
Until Event = #PB_Event_CloseWindow


If you select one item, you get 0 as result.
If you select more than one the result is Ok.


Last edited by infratec on Tue Sep 17, 2019 9:40 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] ListEx (all OS / DPI)
PostPosted: Tue Sep 17, 2019 9:39 am 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4308
Location: Germany
Hi,

next one:

Code:
IncludeFile "../pbi/ListExModule.pbi"

OpenWindow(0, 100, 100, 300, 220, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

ListEx::Gadget(0, 5, 5, 290, 190, "Test", 50, "", ListEx::#GridLines|ListEx::#MultiSelect, 0)

ListEx::AddItem(0, ListEx::#LastItem, "Line 1")
ListEx::AddItem(0, ListEx::#LastItem, "Line 2")
ListEx::AddItem(0, ListEx::#LastItem, "Line 3")
ListEx::AddItem(0, ListEx::#LastItem, "Line 4")
ListEx::AddItem(0, ListEx::#LastItem, "Line 5")

ListEx::SetColor(0, ListEx::#AlternateRowColor, $909090)

Repeat
  Event = WaitWindowEvent()
 
Until Event = #PB_Event_CloseWindow

If you select more than one entry, the alternate color of all lines disappears.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Modules] ListEx (all OS / DPI)
PostPosted: Wed Sep 18, 2019 7:18 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
Bugfixes: CountItems / alternate color / shift-select

_________________
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  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 150 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10

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:  
cron

 


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