Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » what is dword?
what is dword? [message #27134] Sun, 27 June 2010 15:35 Go to next message
281264 is currently offline  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 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

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 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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
Previous Topic: How to create a Dialog
Next Topic: U++ vs Qt
Goto Forum:
  


Current Time: Thu Mar 28 10:33:35 CET 2024

Total time taken to generate the page: 0.01550 seconds