It is currently Fri May 24, 2013 1:43 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 429 posts ]  Go to page Previous  1 ... 21, 22, 23, 24, 25, 26, 27 ... 29  Next
Author Message
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Nov 16, 2010 8:52 pm 
Offline
User
User

Joined: Sun Feb 18, 2007 11:57 am
Posts: 26
...but does not clear the UI where the sort arrow remains...


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Nov 17, 2010 8:42 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
linkerstorm wrote:
...but does not clear the UI where the sort arrow remains...
No, you're right.
I forgot this. Should be fixed in version 4.49 (uploaded).

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Thu Nov 18, 2010 7:20 am 
Offline
User
User

Joined: Sun Feb 18, 2007 11:57 am
Posts: 26
Thanx gnozal !


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Nov 23, 2010 8:28 am 
Offline
PureBasic Protozoa
PureBasic Protozoa
User avatar

Joined: Fri Apr 25, 2003 3:08 pm
Posts: 3011
Gnozal, is it possible to sort on more than one column at a time?

I.e: I have a time and date field and I want the date field to be sorted first and then the time field for each date?

_________________
Resist FaceBorg or have your ass laminated!


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Nov 24, 2010 10:38 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
Fangbeast wrote:
Gnozal, is it possible to sort on more than one column at a time?
I.e: I have a time and date field and I want the date field to be sorted first and then the time field for each date?
No.
PureLVSORT uses the API LVM_SORTITEMS message, so I don't think it's possible.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Nov 24, 2010 11:34 am 
Offline
PureBasic Protozoa
PureBasic Protozoa
User avatar

Joined: Fri Apr 25, 2003 3:08 pm
Posts: 3011
Okay, thanks. Pity.

When I first show records from my application, I use SQLite's ability to sort on more than one column and I was hoping to allow users to do the same live when a column was clicked.

Oh well.

_________________
Resist FaceBorg or have your ass laminated!


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Sat Nov 27, 2010 6:50 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon May 29, 2006 11:29 am
Posts: 238
Location: BARCELONA - SPAIN
:) Hi Gnozal,
I have a problem with my editing callback function when I need to identify the ListIconNumber that has invoked the editing callback function.
Please, look a this piece of test code:
Code:
;
; PureLVSORT listicon editing example
;
Procedure.l MyEditCallback(Event.l, ListIconNumber.l, Column.l, Row.l, text.s)
   Debug "*** EDITING CALLBACK"
   Select Event
      Case #PureLVSORT_EditStart
         Debug "ListIcon = "   + Str(ListIconNumber)
         Debug "Column = " + Str(Column)
         Debug "Row = " + Str(Row)
         Debug "-> Editing started"
         ;ADDED
         Debug ListIconNumber
         ;
         ; Return   : - 0 to enable stringgadget
         ;                - *string to enable spingadget [the string holds the choice items]
         ;
         ProcedureReturn @"700|800|900|1000"
      Case #PureLVSORT_EditText
         Debug "ListIcon = "   + Str(ListIconNumber)
         Debug "Column = " + Str(Column)
         Debug "Row = " + Str(Row)
         Debug "-> Text = " + text
         ;ADDED
         Debug ListIconNumber
         ;
         ; Return   : - 0 to keep the text
         ;                - *string to change the text [the string holds the changed text]
         ;
         If text = "Change this text"
            ProcedureReturn @"to another text"
         EndIf
      Case #PureLVSORT_EditEnd
         Debug "Editing ended"
         ;ADDED
         Debug ListIconNumber
      Case #PureLVSORT_EditEscape
         Debug "Editing cancelled"
         ;ADDED
         Debug ListIconNumber
   EndSelect
   Debug "******************"
EndProcedure
;
#Window_0   = 0
#ListIcon_0 = 100
Procedure Open_Window_0()
   If OpenWindow(#Window_0, 0, 0, 602, 302, "PureLVSORT Make Editable Test",   #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered | #PB_Window_MaximizeGadget| #PB_Window_MinimizeGadget | #PB_Window_SizeGadget)
         ListIconGadget(#ListIcon_0, 5, 5, 590, 255, "String", 100)
         AddGadgetColumn(#ListIcon_0, 1, "Numeric", 110)
         AddGadgetColumn(#ListIcon_0, 2, "Float", 110)
         AddGadgetColumn(#ListIcon_0, 3, "DateDDMMYYYY", 120)
         AddGadgetColumn(#ListIcon_0, 4, "DateMMDDYYYY", 120)
         AddGadgetColumn(#ListIcon_0, 5, "DateMMDDYYYY", 120)
         AddGadgetItem(#ListIcon_0, -1, "ABCDE" + Chr(10) + "514" + Chr(10) + "1000" + Chr(10) + "31/12/2004" + Chr(10) + "12/31/2004" + Chr(10) + "12/31/2004")
         AddGadgetItem(#ListIcon_0, -1, "ACDEF" + Chr(10) + "118" + Chr(10) + "700" + Chr(10) + "11/12/2004" + Chr(10) + "12/11/2004" + Chr(10)+ "12/11/2004")
         AddGadgetItem(#ListIcon_0, -1, "ZABCD" + Chr(10) + "-414" + Chr(10) + "800" + Chr(10) + "21/01/2003" + Chr(10) + "01/21/2003" + Chr(10)+ "12/11/2004")
         For n=1 To 25
            AddGadgetItem(#ListIcon_0, -1, "DEFGH" + Chr(10) + "extra entry "+Str(n) + Chr(10) + "900" + Chr(10) + "10/06/2001" + Chr(10) + "06/10/2001" + Chr(10)+ "12/11/2004")
         Next
   EndIf
EndProcedure
Open_Window_0()
; ListIcon Sort Setup
If PureLVSORT_SelectGadgetToSort(#ListIcon_0, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
   PureLVSORT_SetColumnFlag(#ListIcon_0, 0, #PureLVSORT_Column_Hidden) ; Hide column 0
   PureLVSORT_SetColumnType(#ListIcon_0, 0, #PureLVSORT_String)
   PureLVSORT_SetColumnType(#ListIcon_0, 1, #PureLVSORT_Numeric)
   PureLVSORT_SetColumnType(#ListIcon_0, 2, #PureLVSORT_Float)
   PureLVSORT_SetColumnType(#ListIcon_0, 3, #PureLVSORT_DateDDMMYYYY)
   PureLVSORT_SetColumnType(#ListIcon_0, 4, #PureLVSORT_DateMMDDYYYY)
   PureLVSORT_SetLastColumnAutoResize(#ListIcon_0, #True)
   PureLVSORT_MakeColumnEditable(#ListIcon_0, 2, #True) ; Column 2 is editable
   PureLVSORT_SetEditingColors(#Red, #White)
   PureLVSORT_SetEditingCallback(@MyEditCallback()) ; Set editing callback
EndIf
;
Repeat
   Event = WaitWindowEvent()
   Select Event
      Case #PB_Event_Gadget
   EndSelect
Until Event = #PB_Event_CloseWindow
End

In the events #PureLVSORT_EditEnd and #PureLVSORT_EditEscape, ListIconNumber is equal to -1.
Is that correct?
I'm using PB4.51 + W7
Thanks in advanced.

_________________
QuimV


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Nov 29, 2010 12:03 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
QuimV wrote:
In the events #PureLVSORT_EditEnd and #PureLVSORT_EditEscape, ListIconNumber is equal to -1.
Is that correct?
Yes, it its.
The #PureLVSORT_EditEnd and #PureLVSORT_EditEscape events do not set any parameters (-> ListIconNumber=-1, Column=-1, Row=-1, text="").
This should no be a problem, as you can only edit one Listicongadget at the time (#PureLVSORT_EditEnd is sent if the Listicongadget looses focus).

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Nov 29, 2010 5:29 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon May 29, 2006 11:29 am
Posts: 238
Location: BARCELONA - SPAIN
:) OK,
Thanks Gnozal!

_________________
QuimV


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Dec 01, 2010 12:29 am 
Offline
Enthusiast
Enthusiast

Joined: Mon May 29, 2006 11:29 am
Posts: 238
Location: BARCELONA - SPAIN
:( Gnozal,
I tried this piece of code and it seems that the #PureLVSORT_EditEnd event is not fired when the ListIcon loses the focus. Is a correct behavior?
Code:
;
; PureLVSORT listicon editing example
;
Procedure.l MyEditCallback(Event.l, ListIconNumber.l, Column.l, Row.l, text.s)
   Debug "*** EDITING CALLBACK"
   Select Event
      Case #PureLVSORT_EditStart
         Debug "ListIcon = "   + Str(ListIconNumber)
         Debug "Column = " + Str(Column)
         Debug "Row = " + Str(Row)
         Debug "-> Editing started"
         ;
         ; Return   : - 0 to enable stringgadget
         ;                - *string to enable spingadget [the string holds the choice items]
         ;
         ProcedureReturn @"700|800|900|1000"
      Case #PureLVSORT_EditText
         Debug "ListIcon = "   + Str(ListIconNumber)
         Debug "Column = " + Str(Column)
         Debug "Row = " + Str(Row)
         Debug "-> Text = " + text
         ;
         ; Return   : - 0 to keep the text
         ;                - *string to change the text [the string holds the changed text]
         ;
         If text = "Change this text"
            ProcedureReturn @"to another text"
         EndIf
      Case #PureLVSORT_EditEnd
         Debug "Editing ended"
      Case #PureLVSORT_EditEscape
         Debug "Editing cancelled"
   EndSelect
   Debug "******************"
EndProcedure
;
#Window_0 = 0
#ListIcon_0 = 0
Procedure Open_Window_0()
   If OpenWindow(#Window_0, 0, 0, 602, 320, "PureLVSORT Make Editable Test",   #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered | #PB_Window_MaximizeGadget| #PB_Window_MinimizeGadget | #PB_Window_SizeGadget)
         ListIconGadget(#ListIcon_0, 5, 5, 590, 255, "String", 100)
         AddGadgetColumn(#ListIcon_0, 1, "Numeric", 110)
         AddGadgetColumn(#ListIcon_0, 2, "Float", 110)
         AddGadgetColumn(#ListIcon_0, 3, "DateDDMMYYYY", 120)
         AddGadgetColumn(#ListIcon_0, 4, "DateMMDDYYYY", 120)
         AddGadgetColumn(#ListIcon_0, 5, "DateMMDDYYYY", 120)
         AddGadgetItem(#ListIcon_0, -1, "ABCDE" + Chr(10) + "514" + Chr(10) + "1000" + Chr(10) + "31/12/2004" + Chr(10) + "12/31/2004" + Chr(10) + "12/31/2004")
         AddGadgetItem(#ListIcon_0, -1, "ACDEF" + Chr(10) + "118" + Chr(10) + "700" + Chr(10) + "11/12/2004" + Chr(10) + "12/11/2004" + Chr(10)+ "12/11/2004")
         AddGadgetItem(#ListIcon_0, -1, "ZABCD" + Chr(10) + "-414" + Chr(10) + "800" + Chr(10) + "21/01/2003" + Chr(10) + "01/21/2003" + Chr(10)+ "12/11/2004")
         For n=1 To 25
            AddGadgetItem(#ListIcon_0, -1, "DEFGH" + Chr(10) + "extra entry "+Str(n) + Chr(10) + "900" + Chr(10) + "10/06/2001" + Chr(10) + "06/10/2001" + Chr(10)+ "12/11/2004")
         Next
         ;ADDED
         ButtonGadget(1000,5,260,590,60,"Click here and ListIcon lose focus, but not abandon the edit state. PureLVSORT_EditEnd is sent if the Listicongadget loses focus?", #PB_Button_MultiLine)
   EndIf


EndProcedure
Open_Window_0()
; ListIcon Sort Setup
If PureLVSORT_SelectGadgetToSort(#ListIcon_0, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
   PureLVSORT_SetColumnFlag(#ListIcon_0, 0, #PureLVSORT_Column_Hidden) ; Hide column 0
   PureLVSORT_SetColumnType(#ListIcon_0, 0, #PureLVSORT_String)
   PureLVSORT_SetColumnType(#ListIcon_0, 1, #PureLVSORT_Numeric)
   PureLVSORT_SetColumnType(#ListIcon_0, 2, #PureLVSORT_Float)
   PureLVSORT_SetColumnType(#ListIcon_0, 3, #PureLVSORT_DateDDMMYYYY)
   PureLVSORT_SetColumnType(#ListIcon_0, 4, #PureLVSORT_DateMMDDYYYY)
   PureLVSORT_SetLastColumnAutoResize(#ListIcon_0, #True)
   PureLVSORT_MakeColumnEditable(#ListIcon_0, 2, #True) ; Column 2 is editable
   PureLVSORT_SetEditingColors(#Red, #White)
   PureLVSORT_SetEditingCallback(@MyEditCallback()) ; Set editing callback
EndIf
;
Repeat
   Event = WaitWindowEvent()
   Select Event
      Case #PB_Event_Gadget
   EndSelect
Until Event = #PB_Event_CloseWindow
End


Thanks in advanced

_________________
QuimV


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Dec 01, 2010 12:22 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
QuimV wrote:
I tried this piece of code and it seems that the #PureLVSORT_EditEnd event is not fired when the ListIcon loses the focus. Is a correct behavior?
Sorry, my statement was incorrect.
I meant it fires a #PureLVSORT_EditEnd event when you click on another cell of the listicon : the edited cell looses the focus, another gains it.
The editing does not end if you click on another gadget.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Dec 01, 2010 7:32 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon May 29, 2006 11:29 am
Posts: 238
Location: BARCELONA - SPAIN
:D OK Gnozal,

One question more!
When the user click another gadget and the ListIcon lose the focus, How could I end or cancel the current edition programatically?
Is it possible?
Thanks in advanced.

_________________
QuimV


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Thu Dec 02, 2010 9:19 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
QuimV wrote:
When the user click another gadget and the ListIcon lose the focus, How could I end or cancel the current edition programatically?
Is it possible?
Did you try PureLVSORT_CancelCellEditing() ?

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Thu Dec 02, 2010 11:34 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon May 29, 2006 11:29 am
Posts: 238
Location: BARCELONA - SPAIN
Yes, but what can I do if I need to end accepting the edition?

_________________
QuimV


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Fri Dec 03, 2010 3:09 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
Update (PureLVSORT Plus for PB4.5x)

Changes :
- added PureLVSORT_ExitCellEditing()
  Exit current cell editing (if any) and keep the current cell value.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 429 posts ]  Go to page Previous  1 ... 21, 22, 23, 24, 25, 26, 27 ... 29  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 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