Home » Community » Newbie corner » what is dword?
what is dword? [message #27134] |
Sun, 27 June 2010 15:35 |
281264
Messages: 270 Registered: June 2010 Location: Spain
|
Experienced Member |
|
|
I am seeing that dword is used in many methods, such as:
virtual void MouseMove(Point p, dword keyflags)
I am not able to find any reference to dword in the help.
Talking about the quoted function: what is expected to be in Point? And in dword? How these parameters are passed as arguments?
Thanks,
Javier
|
|
|
Re: what is dword? [message #27138 is a reply to message #27134] |
Sun, 27 June 2010 16:02 |
|
DWORD is not a C++ type, it's defined in <windows.h>.
dword - bit field like unsigned int.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
Re: what is dword? [message #27139 is a reply to message #27134] |
Sun, 27 June 2010 16:40 |
|
281264 wrote on Sun, 27 June 2010 15:35 | I am seeing that dword is used in many methods, such as:
virtual void MouseMove(Point p, dword keyflags)
I am not able to find any reference to dword in the help.
Talking about the quoted function: what is expected to be in Point? And in dword? How these parameters are passed as arguments?
Thanks,
Javier
|
Hi,
As Sergey said already, dword is just 32bit integer. It originates in windows, but U++ defines it on other platforms as well.
The meaning of this function is also simple. U++ internals call it every time when mouse changes position. Point is a simple struct with two members, x and y, which tell you the position of the mouse pointer. The second argument, keyflags, tells you what special keys are pressed and/or if the mouse buttons are pressed. Each bit in the dword corresponds to one key/button. Most of the bits can be checked easily using enumerated values defined in CtrlCore.h and simple logic operations (e.g. if(keyflags&(K_MOUSELEFT|K_SHIFT)){...})
The whole idea behind is this: If you write your own class, you just override the MouseMove, Left/RightUp/Down, MouseEnter/Leave, MouseWheel, Key etc. Inside those functions, you can put the code that controls the interaction of your Ctrl/dialog with user input events. The arguments tell you the relevant information.
Have a look at reference/Events, many of the input related functions is shown there.
Bye,
Honza
|
|
|
Goto Forum:
Current Time: Fri Mar 29 12:05:06 CET 2024
Total time taken to generate the page: 0.01329 seconds
|