It is currently Sat Apr 21, 2018 3:58 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 433 posts ]  Go to page Previous  1 ... 25, 26, 27, 28, 29
Author Message
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Fri Sep 28, 2012 2:45 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jun 09, 2003 8:30 am
Posts: 194
that's cool :D

thank you

now i have to look to receive the coords of each listiconfield

_________________
사십 둘 .


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Sat Oct 06, 2012 2:53 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5761
Location: Wales, UK
Hi gnozal

Using:
SendMessage_(GadgetID(#MyListIcon), #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_GRIDLINES, #LVS_EX_GRIDLINES)

Over-rules the PB attribute:
SetGadgetColor(#MyListIcon,#PB_Gadget_LineColor,RGB(127,157,185))

So, could we have:
PureCOLOR_SetGadgetLineColor(#MyListIcon,RGB(127,157,185))

or:
PureLVSORT_LineColor(#MyListIcon,RGB(127,157,185))

The default MS Windows line colour is almost impossible to see (for some of us at least) :)

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Oct 15, 2012 4:46 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
IdeasVacuum wrote:
...
So, could we have:
PureCOLOR_SetGadgetLineColor(#MyListIcon,RGB(127,157,185))
or:
PureLVSORT_LineColor(#MyListIcon,RGB(127,157,185))
The default MS Windows line colour is almost impossible to see (for some of us at least) :)
I am afraid that is not going to happen, as these libraries do not "ownerdraw" the listicon like pb does.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Fri Oct 26, 2012 3:06 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jun 09, 2003 8:30 am
Posts: 194
there is on eissue concerning the editingmode.
Maybe a kind of bug.

In my efforts to incorporate a keyboardcontrolling to a ListIconGadget
a stumbled on this.
Editing with DEL-KEY does not update the TEXT in the callback at once
like other editinputs do.
This is a little bit annoying because i have to manage the editstate when exiting
the editmode with up or down arrow to switch to the next field.
I need the correct edited value to write it immediately into a database when changed
(left and right-arrow are not considered)

Here some code to test. Arrowing up and down in editmode does work.
The recognition of changed values (when up or down) depends on the last editinput.
DEL is not recognized.
Leaving the EditMode with ENTER is ok in this case.

Code:
;
; List
EnableExplicit

Enumeration ;window
  #win
EndEnumeration

Enumeration ;gadgets
  #b_Get
  #b_Quit
  #Li 
EndEnumeration


Enumeration ;shortcuts menu
  #sk_down
  #sk_up
 
EndEnumeration

Global.l celly, cellx, cellheight, celltop, cellleft, cellmaxrow, celledited, celleditmode
Global.s celltextedit, celltext

Procedure LvFilterCallback(LV.l, Filterstring.s, Column.l, Event.l) ; simple search example
  Protected itemNumber.l, I.l
  If Filterstring
    itemNumber = -1
    If IsGadget(LV)
      For I = 0 To CountGadgetItems(LV) - 1
        If FindString(UCase(GetGadgetItemText(LV, I, Column)), UCase(FilterString),0)
          itemNumber = I
          Break
        EndIf
      Next
      If itemNumber <> -1 ; if string found, scroll to row
        PureLVSORT_ScrollToRow(LV, itemNumber)
        PureCOLOR_SetCellColor(LV, itemnumber,Column,#Blue,$FFDEAD)
      EndIf
    EndIf
  EndIf
EndProcedure

Procedure.l LvEditCallback(Event.l, ListIconNumber.l, Column.l, Row.l, Text.s)
  Select Event
    Case #PureLVSORT_EditStart
      Debug "Edit Start"
      celltext=GetGadgetItemText(ListIconNumber,row,column)
      Debug "edt_start :"+celltext
      celleditmode=1
      ; Return  :   - 0 to enable stringgadget (default)
      ;       - *string to enable a spingadget [the string holds the choice items (separator = '|']
    Case #PureLVSORT_EditText
      Debug "Edit Text"
      celltextedit=text
      celledited+1
      Debug "edt_edit :"+celltextedit
      ;Debug "im callback "+celltextedit
      ;         ; Return  :   - 0 to keep the text (default)
      ;         ;       - *string to change the text [the string holds the changed text]
    Case #PureLVSORT_EditEnd
      Debug "Edit End"
      If celledited
        If celltext<>celltextedit
          Debug "-----------------"
          Debug "     down before :"+celltext
          Debug "     down after:"+celltextedit
          Debug "     Ok can be written"
          Debug "-----------------"
        EndIf
       
        celledited=0
        celltextedit=""
        celltext=""
        celleditmode=0
      EndIf
     
    Case #PureLVSORT_EditEscape
      Debug "Edit ESC"
      celleditmode=0
  EndSelect
EndProcedure

Procedure reload()
  Define cols=5,c, r, rows=10 , i , tmp.s, out.s
  HideGadget(#Li,1)
  ClearGadgetItems(#Li)
 
  While GetGadgetItemText(#Li, -1); , 0)
    RemoveGadgetColumn(#Li,0)
  Wend
  RemoveGadgetColumn(#Li,0)
 
  For c=0 To cols
    tmp="Column "+Str(c)
    AddGadgetColumn(#li,c,tmp,20)
  Next c
  tmp=""
 
  For r=0 To rows
    For c=0 To cols
      For i=1 To 5
        tmp+Chr(Random(25)+97)
      Next i
      out+tmp+Chr(10)
      tmp=""
    Next c
    AddGadgetItem(#Li,-1,out)
    out=""
  Next r
 
  PureLVSORT_SelectGadgetToSort(#Li,#PureLVSORT_ShowClickedHeader_No)
  PureLVSORT_DefineFilterCallback(@LvFilterCallback())
  PureLVSORT_SetFilterTimeOut(100)
  PureLVSORT_SetFilter(#Li)
 
  For c=0 To 10
    PureLVSORT_SetColumnWidth(#Li,c,#PureLVSORT_UseHeader)
  Next c
 
  PureLVSORT_SetFilter(#Li)
 
  PureLVSORT_SetFilterTimeOut(25)
  PureLVSORT_DefineFilterCallback(@LvFilterCallback())
  For c=0 To 10-1
    PureLVSORT_MakeColumnEditable(#Li,c,#True)
  Next c
 
  PureLVSORT_SetEditingCallback(@LvEditCallback())
  PureLVSORT_SetEditingColors(RGB(255,222,192),#PureCOLOR_SystemColor)
  HideGadget(#Li,0)
  cellmaxrow=CountGadgetItems(#Li)-1
EndProcedure

Procedure LvMouseClick(GId.i, *vP.Point)
 
  Define vID=GadgetID(GId)
 
  Protected pLVH.LVHITTESTINFO
 
  GetCursorPos_   (*vP)  ;wo ist Maus
  MapWindowPoints_(0, vID, *vP, 1)
  pLVH\pt\x = *vP\x
  pLVH\pt\y = *vP\y
  SendMessage_(vID, #LVM_SUBITEMHITTEST, 0, pLVH)               
  *vP\y = pLVH\iItem      ;row ab 0
  *vP\x = pLVH\iSubItem   ;col ab 0
  celly=*vP\y
  cellx=*vP\x
  ; --- Ergänzung
  Protected rec.RECT , i
  SendMessage_(vid, #LVM_GETSUBITEMRECT, *vp\y, rec)
  rec\left=0
  rec\right=rec\left+GetGadgetItemAttribute(GId,-1,#PB_ListIcon_ColumnWidth,0)
  If *vP\x >0
    For i=1 To *vP\x
      rec\left+GetGadgetItemAttribute(GId,-1,#PB_ListIcon_ColumnWidth, i-1)
      rec\right=rec\left+GetGadgetItemAttribute(GId,-1,#PB_ListIcon_ColumnWidth,i)
    Next
  EndIf
 
  cellheight= rec\bottom-rec\top
  celltop  = rec\top+1
  cellleft = rec\left+1
EndProcedure

ExamineDesktops()
;window, gadgets
Define.l dw=DesktopWidth(0)
Define.l dh=DesktopHeight(0)
Define.l wx,ww,wy,wh
Define.l c
Define p.Point

;events
Define.l event,eventtype,gadget,Menu

Define.l quit

ww=500
wh=500
wx=100;dw/2-ww/2
wy=100;dh/2-wh/2

OpenWindow(#win,wx,wy,ww,wh,"Schaumerma",#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget)
ButtonGadget(#b_Get,0,0,50,20,"reload")
ListIconGadget(#Li,0,20,ww,wh-20,"this",20,#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
HideGadget(#Li,1)

AddKeyboardShortcut(#Win,#PB_Shortcut_Down,#sk_down)
AddKeyboardShortcut(#Win,#PB_Shortcut_Up,#sk_up)

reload()
Define.s Info.s= "Enter Editingmode by doubleclicking (L) one field."+#CRLF$
Info+"Typing on the keyboard will change the TEXT in the Callback accordingly"+#CRLF$
Info+"Only DEL has some kind of ''delay''"+#CRLF$+#CRLF$
Info+" Run in IDE with debug on"

MessageRequester("",Info)

Repeat
  event=WaitWindowEvent()
  eventtype=EventType()
  menu=EventMenu()
  gadget=EventGadget()
 
  Select event
     
    Case #PB_Event_Gadget
      Select gadget
        Case #b_get
          reload()
        Case #Li
          Select eventtype
            Case #PB_EventType_LeftDoubleClick
              LvMouseClick(#Li, p)
              Debug "Mouse celltop "+Str(celltop)
              Debug "Mouse cellheight "+Str(cellheight)
              Debug "Mouse Col "+Str(cellx)
              Debug "Mouse Row "+Str(celly)
             
          EndSelect
      EndSelect
     
    Case #PB_Event_Menu
     
      Select menu
        Case #sk_down
          ;one down
          If celleditmode
            If celledited
              If celltext<>celltextedit
                Debug "-----------------"
                Debug "     down before :"+celltext
                Debug "     down after:"+celltextedit
                Debug "     Ok can be written"
                Debug "-----------------"
              EndIf
             
              celledited=0
              celltextedit=""
              celltext=""
            EndIf
            If celly <= cellmaxrow-1 
              celltop+cellheight
              celly+1
              Debug "celltop "+Str(celltop)+" cellheight "+Str(cellheight)+" Col "+Str(cellx)+" Row "+Str(celly)
              PostMessage_(GadgetID(#Li), #WM_LBUTTONDBLCLK, 0, cellleft| (celltop <<16)) ;<---- double click on x = 12 y = 42 (mouse coordinates)
             
            EndIf
          EndIf
        Case #sk_up
          ;up one up
          If celleditmode
            If celledited
              If celltext<>celltextedit
                Debug "-----------------"
                Debug "     down before :"+celltext
                Debug "     down after:"+celltextedit
                Debug "     Ok can be written"
                Debug "-----------------"
              EndIf
              celledited=0
              celltextedit=""
              celltext=""
            EndIf
           
            If celly >=0+1
             
              celltop-cellheight
              celly-1
              Debug "celltop "+Str(celltop)+" cellheight "+Str(cellheight)+" Col "+Str(cellx)+" Row "+Str(celly)
             
              PostMessage_(GadgetID(#Li), #WM_LBUTTONDBLCLK, 0, cellleft| (celltop <<16)) ;<---- double click on x = 12 y = 42 (mouse coordinates)
            EndIf
          EndIf
         
      EndSelect
     
    Case #PB_Event_CloseWindow
      quit+1
  EndSelect
 
Until quit

End

_________________
사십 둘 .


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Oct 29, 2012 9:53 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
bobobo wrote:
there is on eissue concerning the editingmode.
Maybe a kind of bug.
Hi,
I have uploaded a new library version : http://gnozal.ucoz.com/PureLVSORT_460.zip
Could you test it ?

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


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Oct 30, 2012 8:13 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jun 09, 2003 8:30 am
Posts: 194
i will check it tomorrow , thanks :-)

_________________
사십 둘 .


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Oct 31, 2012 2:36 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jun 09, 2003 8:30 am
Posts: 194
:D it works now

the code in viewtopic.php?p=394573#p394573
is working now

So somekind of Keyboard-controlling with Your PureLVSort enhanced-Lib can be done.

Splendid !!!

_________________
사십 둘 .


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Mar 27, 2013 3:29 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Library updated for PB5.1x

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


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Mar 27, 2013 6:34 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jun 09, 2003 8:30 am
Posts: 194
yipee :lol:

_________________
사십 둘 .


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Fri Sep 20, 2013 4:46 am 
Offline
User
User

Joined: Tue Dec 08, 2009 7:42 am
Posts: 38
Hi all,
There is a problem with PB 5.20 and library misc . Is there a new version ?
Thanks on advance


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Fri Sep 20, 2013 7:03 am 
Offline
Addict
Addict

Joined: Fri Nov 09, 2012 11:04 pm
Posts: 1546
Location: Uttoxeter, UK
The commands are all still available but have been moved to more appropriate places.

ElapsedMilliseconds() has been moved to System, for instance.

So you should still be able to find them all.

_________________
DE AA EB


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Sat Dec 21, 2013 4:32 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Jan 13, 2006 12:14 am
Posts: 255
Hi, can some tell me, how i can select whole text in cell after i double clicked on it, if i use PureLVSORT_MakeColumnEditable function.

Thanks
Karu


Top
 Profile  
Reply with quote  
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Sun Dec 22, 2013 11:57 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Jan 13, 2006 12:14 am
Posts: 255
karu wrote:
Hi, can some tell me, how i can select whole text in cell after i double clicked on it, if i use PureLVSORT_MakeColumnEditable function.

Thanks
Karu


Anybody?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 433 posts ]  Go to page Previous  1 ... 25, 26, 27, 28, 29

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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