English
Forum

Cursor in the list view Controlparas

 
- Page 1 -



Andreas
Koch
Hello together,

I stand again once to one trouble. It's all right therefore, displayed To get, over welchem Listviewitem (slot, row) itself the Cursor straight befindet. my thought is, in the Anschluss on a simulierten Click Getcontrolparas abzufragen and the Whole in a Loop incorporate. has someone a idea, How to the make could or has it even made? I have attempts with mouse_event To works, but the not working.

lovely Greeting

Andreas cook
 
05/22/13  
 



« this Posting watts as Solution marked. »


Thomas
Freier
the had we still, I faith at schedule.
here one mins. example for Tooltip:
 $H windows.ph
 $H commctrl.ph
Struct LVHitTestInfo = X&,Y&,flags&,Item&,SubItem&
Declare LVHTI#,LView&,l%
Dim LVHTI#,LVHitTestInfo

Proc LV_HitTest

    Parameters  LV&,X%,Y%
    ~GetCursorPos(LVHTI#)
    ~ScreenToClient(LV&,LVHTI#)
    SendMessage(LV&,~LVM_SUBITEMHITTEST,0,LVHTI#)
    Return LVHTI#.SubItem&

ENDPROC

Cls
LView& = Create("GridBox",%hwnd,"Test 0;0;100;Test 1;0;100;Test 2;0;100;Bemerkung;0;100",0,20,10,410,200)

WhileLoop 0,4

    AddStrings(LView&,"0 Test " + Str $(&Loop) + "|1 Test " + Str $(&Loop) + "|2 Test " + Str $(&Loop) + "|")

Wend

var Text$="Was is because at all one List view? \nOb tappt im dunkeln's believe or not. "+  \
"Sobald tappt im dunkeln ihren windows-PC switch on, appear already the first List view."+ \
"Wo, ask tappt im dunkeln? On their screen.\nDer windows screen is namely nothing other as one List view.\n"+ \
"(FRABBING)"
SetText LView&, 1, 3, Text$
sendmessage(Lview&,~LVM_SETEXTENDEDLISTVIEWSTYLE,0,~LVM_SUBITEMHITTEST)'markiert The row under the mouse
'sendmessage(LView&,0,~LVM_SETHOVERTIME,10) 'resolve useful one Click from ????
var ToolTip&=create("Tooltip",%hwnd,LView&,"")
var medit%=Create("MultiEdit",%hwnd,"",0,0,300,-400)
ShowWindow(medit%,0)

While 1

    WaitInput 100
    l% =  LV_HitTest(LView&,%mousex,%mousey)
    '

    SELECT LVHTI#.Item&

        CASEOF 1'ZEILE

        If LVHTI#.SubItem&=3'ITEM

            SetText medit%,GetText$(LView&,LVHTI#.Item&,LVHTI#.SubItem&)
            Text$=""

            Whileloop GetLineCount(medit%)'Number of lines

                Text$=text $+GetLine$(medit%,&loop-1)+"\n"'single Lines read and Line break

            Wend

            settext ToolTip&,%hwnd,LView&,Text$

        EndIf

        CASEOF 3'ZEILE

        settext ToolTip&,%hwnd,LView&,"erste Wahl"
        OTHERWISE
        settext ToolTip&,%hwnd,LView&,""

    ENDSELECT

Wend

end

ought to sure on SubClassProc umgestellt go.
 
Gruß Thomas
Windows XP SP2, XProfan X2
05/22/13  
 



know do I not, but the wide the Split can imho with
LVM_GETCOLUMNWIDTH detect, by less Mausposition-X might one so The
slot herausbekommen.

there's but too LVM_GETITEMINDEXRECT (  [...]  ) what Perhaps yet hilfreicher is.
LVM_FIRST = $1000
LVM_GETCOLUMNWIDTH = ~LVM_FIRST + 29
LVM_SETCOLUMNWIDTH = ~LVM_FIRST + 30

Proc GetColWidth

    Parameters hGBox&, ColNr%
    Declare ColWidth%
    ColWidth% = SendMessage( hGBox&, ~LVM_GetColumnWidth, ColNr%, 0)
    Return ColWidth%

ENDPROC


Click vlt. simply so:
Def mouse_event(5) !"USER32","mouse_event"
mouse_event(2,0,0,0,0)'left maustaste down
mouse_event(4,0,0,0,0)'left maustaste again high
 
05/22/13  
 




Thomas
Freier
the had we still, I faith at schedule.
here one mins. example for Tooltip:
 $H windows.ph
 $H commctrl.ph
Struct LVHitTestInfo = X&,Y&,flags&,Item&,SubItem&
Declare LVHTI#,LView&,l%
Dim LVHTI#,LVHitTestInfo

Proc LV_HitTest

    Parameters  LV&,X%,Y%
    ~GetCursorPos(LVHTI#)
    ~ScreenToClient(LV&,LVHTI#)
    SendMessage(LV&,~LVM_SUBITEMHITTEST,0,LVHTI#)
    Return LVHTI#.SubItem&

ENDPROC

Cls
LView& = Create("GridBox",%hwnd,"Test 0;0;100;Test 1;0;100;Test 2;0;100;Bemerkung;0;100",0,20,10,410,200)

WhileLoop 0,4

    AddStrings(LView&,"0 Test " + Str $(&Loop) + "|1 Test " + Str $(&Loop) + "|2 Test " + Str $(&Loop) + "|")

Wend

var Text$="Was is because at all one List view? \nOb tappt im dunkeln's believe or not. "+  \
"Sobald tappt im dunkeln ihren windows-PC switch on, appear already the first List view."+ \
"Wo, ask tappt im dunkeln? On their screen.\nDer windows screen is namely nothing other as one List view.\n"+ \
"(FRABBING)"
SetText LView&, 1, 3, Text$
sendmessage(Lview&,~LVM_SETEXTENDEDLISTVIEWSTYLE,0,~LVM_SUBITEMHITTEST)'markiert The row under the mouse
'sendmessage(LView&,0,~LVM_SETHOVERTIME,10) 'resolve useful one Click from ????
var ToolTip&=create("Tooltip",%hwnd,LView&,"")
var medit%=Create("MultiEdit",%hwnd,"",0,0,300,-400)
ShowWindow(medit%,0)

While 1

    WaitInput 100
    l% =  LV_HitTest(LView&,%mousex,%mousey)
    '

    SELECT LVHTI#.Item&

        CASEOF 1'ZEILE

        If LVHTI#.SubItem&=3'ITEM

            SetText medit%,GetText$(LView&,LVHTI#.Item&,LVHTI#.SubItem&)
            Text$=""

            Whileloop GetLineCount(medit%)'Number of lines

                Text$=text $+GetLine$(medit%,&loop-1)+"\n"'single Lines read and Line break

            Wend

            settext ToolTip&,%hwnd,LView&,Text$

        EndIf

        CASEOF 3'ZEILE

        settext ToolTip&,%hwnd,LView&,"erste Wahl"
        OTHERWISE
        settext ToolTip&,%hwnd,LView&,""

    ENDSELECT

Wend

end

ought to sure on SubClassProc umgestellt go.
 
Gruß Thomas
Windows XP SP2, XProfan X2
05/22/13  
 




Andreas
Koch
Hello your both,

integrally cordial Thanks for eure Answer. I wurschtel already whom whole day rum, but now works.
Kurzes Feedback: circa Getcontrolparas benefit to, must to the pressing and the release simulate , was unfortunately for my ursprünglichen object not integrally suitable, functions but still with mouse_event.
this Tooltip for List view was crept genial, very the I sought have. thanks.

PS: I had here time demand, whether one The Listviewposition (slot, row) the Editcontrols with the lever Getvar(0) detect can. the functions too with the method: one certainly with Getwindowrect position and measurement the Edits and uses subsequently whom Hittest with the Mittelwerten from getwindowrect. If the Whole in of/ one Loop with the Abbruchbedingung While Getvar(0) made becomes, get one constantly The actually position.
 
05/22/13  
 



 
05/22/13  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

9.021 Views

Untitledvor 0 min.
Member 154727709/23/18
Erfurt12/28/16
Michael W.07/07/16
Georg Teles06/29/16
More...

Themeninformationen

this Topic has 3 subscriber:

Andreas Koch (2x)
iF (2x)
Thomas Freier (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie