Article View: borland.public.cppbuilder.nativeapi
Article #8830Re: How to catch a mouseup on the right scrollbar of a TDBGrid?
From: Paolo Borlandi
Date: Tue, 21 Sep 2004 15:07
Date: Tue, 21 Sep 2004 15:07
72 lines
3439 bytes
3439 bytes
That is what I did!!
Thank YOU!!
"Mark Jacobs" <markj atty critical dotty co dotty uk> ha scritto nel
messaggio news:41471202@newsgroups.borland.com...
> "Paolo Borlandi" <pborlandi@virgilio.it> wrote in message
> news:4146e331@newsgroups.borland.com...
> | I need to trap the mouseup event shooten from the right scrollbar of a
> | TDBGrid to refresh an image corresponding to a grid row. Using the
scrollbar
> | results to move the selection bar to another row and also the image must
be
> | reloaded. Have some suggestion?
>
> You're better off trapping the much more generic "I have moved to a
different
> record" event. This is actually the OnDataChange of the DataSource object
> connected to the DBGrid and TTable objects you are using. Here is an
example
> using an AdsTable descendant of TTable :-
>
>
//--------------------------------------------------------------------------
-
> // Triggered when going to a new record (row)
> void __fastcall TForm1::DataSource1DataChange(TObject *Sender,TField
*Field)
> {
> AnsiString delmes,fnm,peace; int ii; char sng='\'';
> if (DBGrid1->LayoutLock!=0 || AdsTable1->ControlsDisabled()) return;
> if (filtno==0)
> {
> recallbtn->Enabled=false; StatusBar1->Panels->Items[1]->Text="";
> StatusBar1->Panels->Items[2]->Text="No.Recs.=0";
> recdsp->Text="No Records to Display\r\n"; return;
> }
> if (AdsTable1->RecNo>0 && AdsTable1->AdsIsRecordDeleted(0))
> {
> delmes=" Deleted"; recallbtn->Enabled=true;
> }
> else { delmes=""; recallbtn->Enabled=false;}
>
>
StatusBar1->Panels->Items[1]->Text="Rec.No."+mjfmtnm(AdsTable1->RecNo)+delme
s;
> StatusBar1->Panels->Items[2]->Text="No.Recs.="+mjfmtnm(filtno);
> recdsp->Text=mjdsprec(AdsTable1,fldlist); DBGrid1ColEnter(Sender);
> }
>
//--------------------------------------------------------------------------
-
> // Triggered when going to a new field (column)
> void __fastcall TForm1::DBGrid1ColEnter(TObject *Sender)
> {
> AnsiString fnm;
> if (!AdsTable1->Active || filtno==0) return;
> fnm=(DBGrid1->SelectedField->FieldName+" ").SubString(1,10)+":";
> if (recdsp->Text.Pos(fnm)>0) wildfindtext(recdsp,0,fnm,false,false);
> }
>
//--------------------------------------------------------------------------
-
> HTH
> --
> Mark Jacobs
> DK Computing
> http://www.dkcomputing.co.uk
> markj atty critical dotty co dotty uk
>
>
Technical Details
Message-ID:
<41504621@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!zen.net.uk!dedekind.zen.co.uk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4146e331@newsgroups.borland.com> <41471202@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,7895f7bf962ab0e1 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Paolo Borlandi" <pborlandi@virgilio.it> Newsgroups: borland.public.cppbuilder.nativeapi References: <4146e331@newsgroups.borland.com> <41471202@newsgroups.borland.com> Subject: Re: How to catch a mouseup on the right scrollbar of a TDBGrid? Date: Tue, 21 Sep 2004 17:07:55 +0200 Lines: 74 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 212.31.242.133 Message-ID: <41504621@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1095779873 212.31.242.133 (21 Sep 2004 08:17:53 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!zen.net.uk!dedekind.zen.co.uk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail