Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #2499 > unrolled thread
| Started by | "Jozo" <racunalo@os.t-com.hr> |
|---|---|
| First post | 2011-11-23 23:37 +0100 |
| Last post | 2011-11-24 21:51 +0100 |
| Articles | 7 — 3 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
Dispatch of ListView Class "Jozo" <racunalo@os.t-com.hr> - 2011-11-23 23:37 +0100
Re: Dispatch of ListView Class D.J.W. van Kooten <public@ic2remove.this.com> - 2011-11-24 12:55 +0100
Re: Dispatch of ListView Class "Jozo" <racunalo@os.t-com.hr> - 2011-11-24 15:30 +0100
Re: Dispatch of ListView Class D.J.W. van Kooten <public@ic2remove.this.com> - 2011-11-24 16:33 +0100
Re: Dispatch of ListView Class "Willie Moore" <williem@wmconsulting.com> - 2011-11-24 11:07 -0600
Re: Dispatch of ListView Class D.J.W. van Kooten <public@ic2remove.this.com> - 2011-11-24 23:49 +0100
Re: Dispatch of ListView Class "Jozo" <racunalo@os.t-com.hr> - 2011-11-24 21:51 +0100
| From | "Jozo" <racunalo@os.t-com.hr> |
|---|---|
| Date | 2011-11-23 23:37 +0100 |
| Subject | Dispatch of ListView Class |
| Message-ID | <jajsid$fs7$1@ss408.t-com.hr> |
Hi all !
Well, I finally began to work with Vo28 SP3 2837 (overlooking to Vulcan).
For now, I have removed some problems in my code ( ACCESS, ASIGN, PSZ-
STRING ) but I have some problems.
I made my small class _LstView based on class DbListView of Eduardo
Fernandes (posted on KnowVo.com 2002).
Problem is the Dispatch method that does not work properly even in my class
or in his. Here is it:
METHOD DisPatch( oEvent ) CLASS _LstView
LOCAL nReturn AS LONGINT
LOCAL oLVI AS OBJECT
nReturn := SUPER:Dispatch(oEvent)
IF oEvent:Message == WM_LBUTTONDOWN .or. ; // Mouse Single Click
oEvent:Message == WM_LBUTTONDBLCLK // Mouse Double Click
// Return in with ListViewColumn occurred the mouse click
self:GetColumnAtPosition(oEvent:Position)
// Return in with ListViewItem occurred the mouse click.
self:GetItemAtPosition(oEvent:Position)
// if occurred a mouse click in over checkbox area
IF SELF:_GetCheckBoxAtPosition(oEvent:Position)
oLVI:= SELF:GetItemAtPosition(oEvent:Position)
IF oLVI != NULL_OBJECT
SELF:_SetCheckedItems(oLVI)
ENDIF
ENDIF
ENDIF
RETURN (nReturn)
The problem is in oEvent:Position ( Error code 16: [Not exported
ariable] )
In VO 2.7 Debuger shows this event as an event of CLASS MouseEvent and all
is ok but in Vo28 this Event is only Event.
Since I am not familiar with C language and also with any Dispatch method I
hope someone can help me.
Thank in advance
Jozo
P.S. Here are another methods of class _LstView:
CLASS _LstView INHERIT ListView
PROTECT aCheckedItems := {} AS ARRAY // ListViewItems checked
METHOD Init( oOwner, nID, oPoint, oDimension ) CLASS _LstView
SUPER:Init( oOwner, nID, oPoint, oDimension )
RETURN SELF
HIDDEN METHOD _GetCheckBoxAtPosition(oPoint) CLASS _LstView
// Return true/false if a mouse click occurred in checkbox area.
LOCAL strucHitTestInfo IS _winLV_HitTestInfo
LOCAL nReturn AS LONGINT
LOCAL lChecked AS LOGIC
IF !SELF:checkboxes
RETURN (FALSE)
ENDIF
lChecked:=FALSE
oPoint := __WCConvertPoint(SELF,oPoint) // don“t remove
strucHitTestInfo.Pt.X := oPoint:X
strucHitTestInfo.Pt.Y := oPoint:Y
nReturn := SendMessage( SELF:handle() , LVM_HITTEST , 0, LONG(_CAST,
@strucHitTestInfo))
IF nReturn != -1
IF strucHitTestInfo.flags == LVHT_ONITEMSTATEICON
lChecked:=TRUE
ENDIF
ENDIF
RETURN (lChecked)
STRUCT _winLV_HitTestInfoEx ALIGN 1
// Extended version of _winLV_HITTESTINFO for latest COMCTL32.
// Used in GetColumnAtPosition method. Need COMCTL32.DLL dated May/1999
or newer.
MEMBER Pt IS _winPoint
MEMBER Flags AS DWORD
MEMBER iItem AS INT
MEMBER iSubItem AS INT
[toc] | [next] | [standalone]
| From | D.J.W. van Kooten <public@ic2remove.this.com> |
|---|---|
| Date | 2011-11-24 12:55 +0100 |
| Message-ID | <kvbsc7hjm7eb5jg346frkvcbqujuasa7e2@4ax.com> |
| In reply to | #2499 |
On Wed, 23 Nov 2011 23:37:01 +0100, "Jozo" <racunalo@os.t-com.hr> wrote: Hello Jozo, >The problem is in oEvent:Position ( Error code 16: [Not exported >variable] ) >In VO 2.7 Debuger shows this event as an event of CLASS MouseEvent and all >is ok but in Vo28 this Event is only Event. If you look in the help under ListViewMouseEvent Class you will see that the event has an access Position. "A Point object that describes the position where the click occurred in list view control coordinates." I wonder if it's a visibility problem due to the import which is then most likely solved by a reindex or a touch your code? You could import one of the samples and inspect the accesses of the event in the debugger - where position should show. Dick
[toc] | [prev] | [next] | [standalone]
| From | "Jozo" <racunalo@os.t-com.hr> |
|---|---|
| Date | 2011-11-24 15:30 +0100 |
| Message-ID | <jalket$irb$1@ss408.t-com.hr> |
| In reply to | #2502 |
Hello Dick, > If you look in the help under ListViewMouseEvent Class you will see > that the event has an access Position. Yes, I know that, but as I have said, in VO 2.7 Debuger shows this event as an event of MouseEvent Class and all is ok but in Vo28 this Event is only Event Class, Class Event that has not properties Position. My _LstView based on class DbListView of Eduardo Fernandes (posted on KnowVo.com 2002) where you can download this example. This example has this problem too. When the mouse move on the second row is then activated Dispatch wich generates general Event instead MouseEvent. I am indexed but nothing. Jozo "D.J.W. van Kooten" <public@ic2remove.this.com> wrote in message news:kvbsc7hjm7eb5jg346frkvcbqujuasa7e2@4ax.com... > On Wed, 23 Nov 2011 23:37:01 +0100, "Jozo" <racunalo@os.t-com.hr> > wrote: > > Hello Jozo, > >>The problem is in oEvent:Position ( Error code 16: [Not exported >>variable] ) >>In VO 2.7 Debuger shows this event as an event of CLASS MouseEvent and all >>is ok but in Vo28 this Event is only Event. > > If you look in the help under ListViewMouseEvent Class you will see > that the event has an access Position. > > "A Point object that describes the position where the click occurred > in list view control coordinates." > > I wonder if it's a visibility problem due to the import which is then > most likely solved by a reindex or a touch your code? > > You could import one of the samples and inspect the accesses of the > event in the debugger - where position should show. > > Dick > >
[toc] | [prev] | [next] | [standalone]
| From | D.J.W. van Kooten <public@ic2remove.this.com> |
|---|---|
| Date | 2011-11-24 16:33 +0100 |
| Message-ID | <p7osc7p2o6svclo22t5266jhnutn32l91u@4ax.com> |
| In reply to | #2503 |
On Thu, 24 Nov 2011 15:30:52 +0100, "Jozo" <racunalo@os.t-com.hr>
wrote:
>Hello Dick,
>
>> If you look in the help under ListViewMouseEvent Class you will see
>> that the event has an access Position.
>Yes, I know that, but as I have said, in VO 2.7 Debuger shows this event as
>an event of MouseEvent Class and all
>is ok but in Vo28 this Event is only Event Class, Class Event that has not
>properties Position.
>
>My _LstView based on class DbListView of Eduardo Fernandes (posted on
>KnowVo.com 2002) where you can download this example.
>This example has this problem too. When the mouse move on the second row is
>then activated Dispatch wich generates general Event instead MouseEvent.
>
>I am indexed but nothing.
>
Jozo
That's tue. In the SDK you'll find:
ACCESS Position AS POINT PASCAL CLASS ListViewMouseEvent
RETURN __WCConvertPoint(SELF:Control, Point{nX, nY})
So the event must be a ListViewMouseEvent.
You could directly use this code but then you need nX and nY (for
which I think I have some code too if you need it).
But I think there's a quicker way:
If you look in the SDK:
METHOD Dispatch(oEvent) CLASS Control
you'll find:
CASE msg == WM_LBUTTONDOWN .OR.;
msg == WM_RBUTTONDOWN .OR.;
msg == WM_MBUTTONDOWN .OR. ;
msg == WM_XBUTTONDOWN
//PP-030904 Xbutton
//uRet :=
SELF:MouseButtonDown(__ObjectCastClassPtr(oEvt, __pCMouseEvent))
uRet := SELF:MouseButtonDown(MouseEvent{oEvt})
So I think that MouseEvent{oEvt} can do the trick as the
Mousebuttondown also needs a MouseEvent and uses the control event as
parameter. See MouseEvent Class in the help.
No idea if anything was changed since 2.7 (I don't use the event in
listboxes) but hopefully it helps you running the program.
Dick
[toc] | [prev] | [next] | [standalone]
| From | "Willie Moore" <williem@wmconsulting.com> |
|---|---|
| Date | 2011-11-24 11:07 -0600 |
| Message-ID | <jaltjp$1nr$1@speranza.aioe.org> |
| In reply to | #2504 |
Dick, There were a lot of changes between 2.7 and 2.8. I had to make a bunch of changes in rightSLE to support the changed methods. Regards, Willie Vulcan VIP
[toc] | [prev] | [next] | [standalone]
| From | D.J.W. van Kooten <public@ic2remove.this.com> |
|---|---|
| Date | 2011-11-24 23:49 +0100 |
| Message-ID | <reitc75pkprod2cahk2jp93ufp3sfccgg0@4ax.com> |
| In reply to | #2506 |
On Thu, 24 Nov 2011 11:07:11 -0600, "Willie Moore" <williem@wmconsulting.com> wrote: Hello Willie, > >There were a lot of changes between 2.7 and 2.8. I had to make a bunch of >changes in rightSLE to support the changed methods. > Yes, I know that <g>. I meant "Changed in the event passed". And given Jozo's reply that what I found worked, it is! Dick
[toc] | [prev] | [next] | [standalone]
| From | "Jozo" <racunalo@os.t-com.hr> |
|---|---|
| Date | 2011-11-24 21:51 +0100 |
| Message-ID | <jamaoh$t34$1@ss408.t-com.hr> |
| In reply to | #2504 |
Thank you Dick.
I found solution based on your example
Here it is:
LOCAL oMoEvt AS MouseEvent
...
IF oEvent:Message == WM_LBUTTONDOWN .OR. ; // Mouse Single Click
oEvent:Message == WM_LBUTTONDBLCLK // Mouse Double Click
oMoEvt := MouseEvent{oEvent}
IF SELF:_GetCheckBoxAtPosition(oMoEvt:Position)
...
Jozo
"D.J.W. van Kooten" <public@ic2remove.this.com> wrote in message
news:p7osc7p2o6svclo22t5266jhnutn32l91u@4ax.com...
> On Thu, 24 Nov 2011 15:30:52 +0100, "Jozo" <racunalo@os.t-com.hr>
> wrote:
>
>>Hello Dick,
>>
>>> If you look in the help under ListViewMouseEvent Class you will see
>>> that the event has an access Position.
>>Yes, I know that, but as I have said, in VO 2.7 Debuger shows this event
>>as
>>an event of MouseEvent Class and all
>>is ok but in Vo28 this Event is only Event Class, Class Event that has not
>>properties Position.
>>
>>My _LstView based on class DbListView of Eduardo Fernandes (posted on
>>KnowVo.com 2002) where you can download this example.
>>This example has this problem too. When the mouse move on the second row
>>is
>>then activated Dispatch wich generates general Event instead MouseEvent.
>>
>>I am indexed but nothing.
>>
> Jozo
>
> That's tue. In the SDK you'll find:
>
> ACCESS Position AS POINT PASCAL CLASS ListViewMouseEvent
> RETURN __WCConvertPoint(SELF:Control, Point{nX, nY})
>
> So the event must be a ListViewMouseEvent.
>
> You could directly use this code but then you need nX and nY (for
> which I think I have some code too if you need it).
>
> But I think there's a quicker way:
>
> If you look in the SDK:
>
> METHOD Dispatch(oEvent) CLASS Control
>
> you'll find:
>
> CASE msg == WM_LBUTTONDOWN .OR.;
> msg == WM_RBUTTONDOWN .OR.;
> msg == WM_MBUTTONDOWN .OR. ;
> msg == WM_XBUTTONDOWN
> //PP-030904 Xbutton
> //uRet :=
> SELF:MouseButtonDown(__ObjectCastClassPtr(oEvt, __pCMouseEvent))
> uRet := SELF:MouseButtonDown(MouseEvent{oEvt})
>
> So I think that MouseEvent{oEvt} can do the trick as the
> Mousebuttondown also needs a MouseEvent and uses the control event as
> parameter. See MouseEvent Class in the help.
>
> No idea if anything was changed since 2.7 (I don't use the event in
> listboxes) but hopefully it helps you running the program.
>
> Dick
>
>
>
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web