I have a ListView with a 5 columns, this LV is filled from a server
and is done OK. By the way I am finishing my Bank Reconciliation program.
The first columns is the check or uncheck one, when this happens
I want the system to process some numbers on the screen,
lets say check this row and add the number in the row to another place on
the screen.
I have accomplish this by getting the number (event??)
of the space bar or the click of the mouse on the check or uncheck column.
I know this is not the correct way of doing this, because is working for
Win 2000 and Win XP, but what happen if is Win 98 or any other.
Can someone help me on this, or should I use the Dispatch method for this.
Example of the code:
******************
//IF oListViewItemEvent:LParam == 1240304 .or.; // for XP
// oListViewItemEvent:LParam == 1240356
IF oListViewItemEvent:LParam == 1240948 .or.; // for Win 2000
oListViewItemEvent:LParam == 1241000
i := oListViewItemEvent:ListViewItem:ItemIndex
IF SELF:oDCListView1:GetItemAttributes(i):Checked
***********************
Any code that can help me do this better.
Thanks in advance
José Zouain
Zeta Concepts, Inc.
Zeta Pro - Inventory Control Accounting System
www.zetaconcepts.com
snip[ Any code that can help me do this better. ]
I would not use a Listview for Bank Reconciliation but a bBrowser.
Just that you have to fill the listview and then you have to broadcast the
changes back to the data.
You could do it faster and live with a Browser.
Phil McGuinness
-------------------
"José Zouain" <jzo...@zetaconcepts.com> wrote in message
news:3c6c3cd6_2@news1...
Phil
Anyway I do it in this case, either a Browser or Listview
I have to process some data before displaying it,
example add up all checks payments with same number, etc.
than I display all this into the LV.
Thanks anyway, but it does not make my life better
If you need to process this data before displaying it, here's a couple of thoughts for you:
If you're going to use a listview, you can do this processing as you load the data into the listview ...
Method LvRefresh() Class MyClass
local oLvItem as ListViewItem
self:oListView:DeleteAll()
self:Server:GoTop()
while !self:Server:Eof
If self::Processed
oLvItem := ListViewItem{}
oLvItem:SetText( Self:Server:SomeField, #LvColumn )
self:oListView:AddItem( oLvItem )
end
self:Server:Skip()
end
Access Processed Class MyClass
local lRetVal as logic
lRetVal := Self:Server:SomeCondition
self:nListViewTotal += if( lRetVal, Self:Server:SomeValue,
0 )
return lRetVal
If you're using a browser, you could either extract the data into a temporary file, performing your processing as a part of that extract, or else set a scope condition, and process the data within that scope prior to refreshing the browser.
hth.
--
g.
Gary Stark
gst...@RedbacksWeb.com
http://RedbacksWeb.com
On Thu, 14 Feb 2002 17:34:33 -0500, "José Zouain"
<jzo...@zetaconcepts.com> wrote:
>The first columns is the check or uncheck one, when this happens
>I want the system to process some numbers on the screen,
>lets say check this row and add the number in the row to another place on
>the screen.
[snip]
I use the following code to test if a checkmark is changing in a
listviewitem (sorry for word wrap, pls try to figure out the lines):
[being paste]
METHOD ListViewItemChanged( oEvent ) CLASS WindowMain
// Para prevenir que cambien los que no deben ser
// marcados
LOCAL oItem AS ListViewItem
SUPER:ListViewItemChanged( oEvent )
// Only if allowed
IF !SELF:lPreventItemChange
IF oEvent != NULL_OBJECT
oItem := oEvent:ListViewItem
IF oItem != NULL_OBJECT
IF oItem:StateImageIndex > 0 .and. oItem:ImageIndex >
1
ApplicationExec( EXECWHILEEVENT )
IF oItem:ImageIndex > 1 .and. oItem:ImageIndex < 4
oItem:StateImageIndex := 0
ELSE
IF oItem:StateImageIndex < 2 .and. ;
ACF_YesNo( SELF, "Advertencia", ;
"El target " + oItem:GetText(
#Descripcion ) + ;
" ya ha sido cargado para este
período." + CRLF + ;
"¿Desea cargarlo de nuevo?",
FALSE ) = BOXREPLYYES
oItem:StateImageIndex := 2
ELSE
oItem:StateImageIndex := 0
ENDIF
ENDIF
SELF:lPreventItemChange := TRUE
SELF:oDCLView:SetItemAttributes( oItem )
SELF:lPreventItemChange := FALSE
// SELF:dwMark += iif( oItem:StateImageIndex ==
2,1,-1 )
ENDIF
ENDIF
ENDIF
ENDIF
RETURN NIL
[end paste]
HTH,
Amilcar A. Camargo F.
Sand, S. A.
Guatemala, C. A.
You don't need to worry about OS specific messages - I think this will just
get you into trouble. Why not use the standard window events already
provided: ListviewKeyDown(), ListViewMouseDown(), ListViewItemChanged(),
ListViewItemChanging() etc. With these you can detect the check box being
ticked etc.
However, if you are using live servers and a substantial number of rows,
bBrowser (as Phil suggested) will make your life a lot easier detecting and
managing these kinds of events ...and it will be 10-15 times faster.
Regards,
Geoff
"José Zouain" <jzo...@zetaconcepts.com> wrote in message
news:3c6c3cd6_2@news1...
What I want is to get the event for ONLY for check/uncheck event
in LV with CheckBoxes.
As simple as that, it did worked when we did it by OS
//IF oListViewItemEvent:LParam == 1240304 .or.; // for XP
// oListViewItemEvent:LParam == 1240356
IF oListViewItemEvent:LParam == 1240948 .or.; // for Win 2000
oListViewItemEvent:LParam == 1241000
i := oListViewItemEvent:ListViewItem:ItemIndex
But if we do it this way:
//IF _and(stLV.uChanged,LVIF_STATE)!= LVIF_STATE
IF stLV.hdr._code = LVN_ITEMCHANGED //LVM_SETITEMSTATE
//LVN_ITEMCHANGED
//LVM_SETITEMSTATE
i := oListViewItemEvent:ListViewItem:ItemIndex
Any light HELP!!!!!!
Thanks anyway
I certainly do my bank reconciliations with a standard list Listview - I
change the colour of the listview row when the client single-clicks - using
ownerdraw techniques - plus show the reconciled and unreconciled totals in
summary SLE's at the bottom of the screens.
I use a hidden column in the listview to hold the logical state (tagged or
untagged) plus provide a Criteria Selection Method to enable batch
tagging/untaging of transactions.
When the user saves the reconcilliation, I traverse the listview and post
the transactions - if the user cancels, ther's nothing at all to do!
This makes reconcilliation an absolute breeze for the user.
If you want to know more, email me and I will send you a boat-load of code.
Regards
John
"José Zouain" <jzo...@zetaconcepts.com> wrote in message
news:3c6c3cd6_2@news1...
> Hi VO guys
>
> I have a ListView with a 5 columns, this LV is filled from a server
> and is done OK. By the way I am finishing my Bank Reconciliation program.
>
> The first columns is the check or uncheck one, when this happens
> I want the system to process some numbers on the screen,
> lets say check this row and add the number in the row to another place on
> the screen.
>
> I have accomplish this by getting the number (event??)
> of the space bar or the click of the mouse on the check or uncheck column.
>
> I know this is not the correct way of doing this, because is working for
> Win 2000 and Win XP, but what happen if is Win 98 or any other.
>
> Can someone help me on this, or should I use the Dispatch method for this.
>
> Example of the code:
> ******************
> file://IF oListViewItemEvent:LParam == 1240304 .or.; // for XP
On Fri, 15 Feb 2002 18:52:47 GMT, jzo...@zetaconcepts.com (Jose
Zouain) wrote:
[snip]
>But if we do it this way:
>//IF _and(stLV.uChanged,LVIF_STATE)!= LVIF_STATE
>IF stLV.hdr._code = LVN_ITEMCHANGED //LVM_SETITEMSTATE
>//LVN_ITEMCHANGED
>
> //LVM_SETITEMSTATE
>
> i := oListViewItemEvent:ListViewItem:ItemIndex
>
>
>Any light HELP!!!!!!
Have you tried Window:ControlNotify(...) event? This kind of message
should come through this channel.
John's solution will obviously work, but there's possibly not a real need to use
the ownerdraw techniques he's describing. You could simply use multiple
selection on the listview, still toggling a hidden column's value if you wished,
but the mere fact that a ListViewItem is selected should be enough for you to do
what you want.
As John says, unless you actually choose to save the (changed state) data from
the listview, nothing in your database actually gets saved, and therefore
updating is a non-issue.
John M Roe wrote:
--
Regards
Regards
José Zouain
Regards
José Zouain
Regards
José Zouain
Regards
José Zouain
Regards
José Zouain
"José Zouain" a écrit :
--
Jean-Marie Berthiaume
Montréal, Québec
Attention. Enlever les # pour me rejoindre
Please erase the # to reply :
(jie...@videotron.ca)
Hi Guys,
I hope not, is not me sorry, is my Provider that had some problem
Do you and Djeff share the same provider? <g>
"José Zouain" wrote:
--
You are always so funny, no offense.
--
Why should I take offense?
I think it might be more offensive were I to actually upset someone with
my remarks; that is never my intent.
Except when talking to, or about, Djeff, of course. He's always fair
game! <g>
"José Zouain" wrote:
--