 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
johnp Guest
|
Posted: Fri May 05, 2006 12:14 pm Post subject: Handlers for Left & Right Dlb Mouse Clicks |
|
|
I want to detect left and right double mouse clicks.
No method exists in BCB6 Standard Ed. for right
dbl clicks so I have these handlers.
However they aren't called. Why ?
//1st Header unit *.h
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <ComCtrls.hpp>
#include <new>
#include <winuser>
using namespace std ;
//--------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TMainMenu *MainMenu1;
void __fastcall FormMouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
void __fastcall FormMouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
private: // None yet . . .
protected: // Windows message handlers follow
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_LBUTTONDBLCLK, TMessage, LeftMsBtnDblClck) ;
MESSAGE_HANDLER(WM_RBUTTONDBLCLK, TMessage, RghtMsBtnDblClck) ;
END_MESSAGE_MAP(TForm);
public: // User stuff
__fastcall TForm1(TComponent* Owner);
void __fastcall LeftMsBtnDblClck(TMessage Message) ;
void __fastcall RghtMsBtnDblClck(TMessage Message) ;
} ;
extern PACKAGE TForm1 *Form1;
#endif
//============================================
//1st .cpp unit *.cpp
#include <vcl.h>
#pragma resource "*.dfm"
#include "graph1.h"
using namespace std ;
TForm1 *Form1 ; //= new TForm1(NULL) ;
//----------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner){}
//-----------------------------------------------
//Handler is not called Why ?
void __fastcall TForm1::LeftMsBtnDblClck(TMessage Message)
{
//. . .do something
;}
//------------------------------------------------
void __fastcall TForm1::RghtMsBtnDblClck(TMessage Message)
{
/. . /do something
;} |
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Fri May 05, 2006 1:14 pm Post subject: Re: Handlers for Left & Right Dlb Mouse Clicks |
|
|
johnp wrote:
| Quote: | I want to detect left and right double mouse clicks.
No method exists in BCB6 Standard Ed. for right
dbl clicks ....
|
Yes there are. They were already in bcb5 and maybe before.
void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
Label1->Caption = "";
if ( Shift.Contains ( ssDouble ) )
{
if ( Button == mbLeft )
Label1->Caption = "ssDouble mbLeft";
else if ( Button == mbRight )
Label1->Caption = "ssDouble mbRight";
}
}
Hans. |
|
| Back to top |
|
 |
johnp Guest
|
Posted: Fri May 05, 2006 8:44 pm Post subject: Re: Handlers for Left & Right Dlb Mouse Clicks |
|
|
Hans
Thanks for that !
"Hans Galema" <notused (AT) notused (DOT) nl> wrote in message
news:445b42e4$1 (AT) newsgroups (DOT) borland.com...
| Quote: | johnp wrote:
I want to detect left and right double mouse clicks.
No method exists in BCB6 Standard Ed. for right
dbl clicks ....
Yes there are. They were already in bcb5 and maybe before.
void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton
Button,
TShiftState Shift, int X, int Y)
{
Label1->Caption = "";
if ( Shift.Contains ( ssDouble ) )
{
if ( Button == mbLeft )
Label1->Caption = "ssDouble mbLeft";
else if ( Button == mbRight )
Label1->Caption = "ssDouble mbRight";
}
}
Hans. |
|
|
| Back to top |
|
 |
|
|
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 You cannot vote in polls in this forum
|
|