Apycom jQuery Menus

class Element : provide basic functions... More...

#include <SDK_Manila_Sense.h>

Inherited by ChildSection, MyEditControl, MyItem, MyLabel, MyPanel, MyPictureBox, MySelector, MySlider, and Section.

Collaboration diagram for Element:

List of all members.

Public Member Functions

 Element (int idElement, int &x, int &y, int typeElement, bool realPos=false)
virtual ~Element (void)
virtual void add (Element *e, int minHeight=-1, int pos=-1, bool mixWithOther=true)
 add componnent (list...)
int getBottom ()
 get the element's bottom position (Be carefull : relative position)
int getHeight ()
 get the element's height
int getId ()
 get the element's ID (You can choose any number)
int getLeft ()
 get the element's left position (Be carefull : relative position)
int getRight ()
 get the element's right position (Be carefull : relative position)
int getTop ()
 get the element's top position (Be carefull : relative position)
int getType ()
 get the element's type (TYPE_ITEM for example)
int getWidth ()
 get the element's width
virtual ElementisClicked (int x, int y)=0
 To test if a position is inside the element...
virtual int mouseGesture ()
 Method called before each frame to take decision according to user gesture.
virtual void paint (DIRECTDRAW_GDI *lpDDraw, int x, int y)=0
 to paint component with correct offset :
void recopiePosition (RECT &dest)
virtual bool run (bool isRightClick=false)
 execute action (Button, text...):
void setBottom (int t)
void setHeight (int t)
void setLeft (int t)
virtual void setMustRedraw ()
 forcing to redraw
void setRight (int t)
void setTop (int t)
void setWidth (int t)
virtual void sizeChanged (Element *src, int width, int height)
 This method is called by components when they change size.
virtual void unClick ()
void WriteBMPFile (HBITMAP bitmap, LPTSTR filename, HDC hDC)
 Used to write HBITMAP into a BMP...

Static Public Member Functions

static bool ConvertToDIB (HBITMAP &hBitmap)
 Convert a HIB to a DIB.
static DIRECTDRAW_GDICreateBitmapMask (DIRECTDRAW_GDI *hbmColour, COLORREF crTransparent)
 Create a binary surface using the color (second parameter) in the first parameter.
static DIRECTDRAW_GDIfromIImageToGDI (IImage **src, bool force32bits=false)
 Can be used to create a compatible surface.
static ElementgetElementByID (int id, int typeExpected=-1)
 Used to access to an element identified by the param id.
static EventHandlergetGestEvent ()
static IImagingFactory * getIImagingFactory ()
static IImage * getImgFromBuffer (BitmapData *dataBuffer)
 Can be used to create an IImage using a BitmapData (use fromIImageToGDI to have a compatible surface).
static HICON loadIcon (wstring fileDst, wstring link)
 Open Icon.
static IImage * loadIImage (wstring *name)
 Can be used to create an IImage from an image (BMP,JPG,PNG,GIF) (use fromIImageToGDI to have a compatible surface).
static DIRECTDRAW_GDIloadImage (wstring *name, bool rescall=false, bool transparent=false)
 Load an image (BMP,JPG,PNG,GIF).
static DIRECTDRAW_GDIloadImageWithAlpha (wstring name, bool rescall)
 When image have alpha informations, use this function to force alpha recognition.
static RECT patchImage (DIRECTDRAW_GDI *bkg, wstring *name, int nbPatch, int posX, int posY)
static void redraw ()
static void reloadAllSurface ()
 Used when screen is rotated (all surfaces must be recomputed).
static void resizeIImage (wstring *name)
 resize the image according to GlobalInformations::percentOfVGA
static bool saveIcon (HICON myIcon, wstring fileDst)
 Save an HICON into image (PNG,JPG,BMP,GIF).
static void sendMsg (int wParam, void *lParam)
 Send message to you defined method (EventHandler::messageTreatment).
static void setGestEvent (EventHandler *val)

Public Attributes

GlobalInformationsgi
 Pointer to GlobalInformations.
Elementowner
 Element which contain this Element.

Static Public Attributes

static bool noError = false
 Set to true if you don't want error messages "image not found".

Protected Member Functions

virtual void loadSurf ()
 load (or reload) surface

Protected Attributes

int idElement
 ID used by event handler (You can choose any number).
bool isActivated
 for button, ctrl, etc...
MouseCtrlmouseEvent
 can ask for changes
int paddingSup
RECT position
 the position relative to other components
RECT positionAbsolute
 the real position on screen (updated each frame)
int typeElement

Friends

class MessageBoxSense

Detailed Description

class Element : provide basic functions...

All printable element will herite from this class

Definition at line 285 of file SDK_Manila_Sense.h.


Constructor & Destructor Documentation

Element::Element ( int  idElement,
int &  x,
int &  y,
int  typeElement,
bool  realPos = false 
)

Definition at line 13 of file Element.cpp.

Element::~Element ( void   )  [virtual]

Definition at line 41 of file Element.cpp.


Member Function Documentation

void Element::add ( Element e,
int  minHeight = -1,
int  pos = -1,
bool  mixWithOther = true 
) [virtual]

add componnent (list...)

Reimplemented in Section, MyPanel, and ChildSection.

Definition at line 56 of file Element.cpp.

bool Element::ConvertToDIB ( HBITMAP &  hBitmap  )  [static]

Convert a HIB to a DIB.

Definition at line 125 of file Element.cpp.

DIRECTDRAW_GDI * Element::CreateBitmapMask ( DIRECTDRAW_GDI hbmColour,
COLORREF  crTransparent 
) [static]

Create a binary surface using the color (second parameter) in the first parameter.

Parameters:
hbmColour surface where a special color will be set to transparent
crTransparent color key used to find area set to transparent
Returns:
binary image (background->white, foreground->black)

Definition at line 975 of file Element.cpp.

DIRECTDRAW_GDI * Element::fromIImageToGDI ( IImage **  src,
bool  force32bits = false 
) [static]

Can be used to create a compatible surface.

Definition at line 642 of file Element.cpp.

int Element::getBottom (  )  [inline]

get the element's bottom position (Be carefull : relative position)

Definition at line 397 of file SDK_Manila_Sense.h.

Element * Element::getElementByID ( int  id,
int  typeExpected = -1 
) [static]

Used to access to an element identified by the param id.

Parameters:
typeExpected is optional (to be sure that the pointer is in the correct type)

Definition at line 887 of file Element.cpp.

static EventHandler* Element::getGestEvent (  )  [inline, static]

Definition at line 383 of file SDK_Manila_Sense.h.

int Element::getHeight (  )  [inline]

get the element's height

Definition at line 391 of file SDK_Manila_Sense.h.

int Element::getId (  )  [inline]

get the element's ID (You can choose any number)

Definition at line 401 of file SDK_Manila_Sense.h.

IImagingFactory * Element::getIImagingFactory (  )  [static]

Definition at line 60 of file Element.cpp.

IImage * Element::getImgFromBuffer ( BitmapData *  dataBuffer  )  [static]

Can be used to create an IImage using a BitmapData (use fromIImageToGDI to have a compatible surface).

Definition at line 244 of file Element.cpp.

int Element::getLeft (  )  [inline]

get the element's left position (Be carefull : relative position)

Definition at line 395 of file SDK_Manila_Sense.h.

int Element::getRight (  )  [inline]

get the element's right position (Be carefull : relative position)

Definition at line 399 of file SDK_Manila_Sense.h.

int Element::getTop (  )  [inline]

get the element's top position (Be carefull : relative position)

Definition at line 393 of file SDK_Manila_Sense.h.

int Element::getType (  )  [inline]

get the element's type (TYPE_ITEM for example)

Definition at line 403 of file SDK_Manila_Sense.h.

int Element::getWidth (  )  [inline]

get the element's width

Definition at line 389 of file SDK_Manila_Sense.h.

virtual Element* Element::isClicked ( int  x,
int  y 
) [pure virtual]

To test if a position is inside the element...

Parameters:
x position of click
y position of click
Returns:
NULL if not clicked, this else

Implemented in MyPictureBox, MyLabel, MySlider, Section, MyEditControl, MyItem, MyPanel, MySelector, and ChildSection.

HICON Element::loadIcon ( wstring  fileDst,
wstring  link 
) [static]

Open Icon.

Parameters:
fileDst where icon is (.exe)
link if fileDst have no icons, try to find from a .lnk

Definition at line 499 of file Element.cpp.

IImage * Element::loadIImage ( wstring *  name  )  [static]

Can be used to create an IImage from an image (BMP,JPG,PNG,GIF) (use fromIImageToGDI to have a compatible surface).

Definition at line 547 of file Element.cpp.

DIRECTDRAW_GDI * Element::loadImage ( wstring *  name,
bool  rescall = false,
bool  transparent = false 
) [static]

Load an image (BMP,JPG,PNG,GIF).

Definition at line 681 of file Element.cpp.

static DIRECTDRAW_GDI* Element::loadImageWithAlpha ( wstring  name,
bool  rescall 
) [static]

When image have alpha informations, use this function to force alpha recognition.

virtual void Element::loadSurf (  )  [inline, protected, virtual]

load (or reload) surface

Reimplemented in MySlider, Section, and ChildSection.

Definition at line 301 of file SDK_Manila_Sense.h.

virtual int Element::mouseGesture (  )  [inline, virtual]

Method called before each frame to take decision according to user gesture.

Use MouseCtrl::changeMouseAnalyse to capture user gesture.

Returns:
In pixel, the scrolling in vertical direction

Reimplemented in MySlider, Section, MyEditControl, MySelector, and ChildSection.

Definition at line 352 of file SDK_Manila_Sense.h.

virtual void Element::paint ( DIRECTDRAW_GDI lpDDraw,
int  x,
int  y 
) [pure virtual]

to paint component with correct offset :

Parameters:
lpDDraw surface to print (GlobalInformations::primaryBuffer for example)
x position of top-left
y position of top-left

Implemented in MyPictureBox, MyLabel, MySlider, Section, MyEditControl, MyItem, MyPanel, MySelector, and ChildSection.

RECT Element::patchImage ( DIRECTDRAW_GDI bkg,
wstring *  name,
int  nbPatch,
int  posX,
int  posY 
) [static]

Definition at line 77 of file Element.cpp.

void Element::recopiePosition ( RECT &  dest  )  [inline]

Definition at line 411 of file SDK_Manila_Sense.h.

void Element::redraw (  )  [static]

Definition at line 904 of file Element.cpp.

void Element::reloadAllSurface (  )  [static]

Used when screen is rotated (all surfaces must be recomputed).

Definition at line 912 of file Element.cpp.

void Element::resizeIImage ( wstring *  name  )  [static]

resize the image according to GlobalInformations::percentOfVGA

Definition at line 570 of file Element.cpp.

bool Element::run ( bool  isRightClick = false  )  [virtual]

execute action (Button, text...):

Parameters:
isRightClick true if event is a right click (long press)
Returns:
true if Element take control of events...

Reimplemented in MyLabel, MySlider, MyEditControl, MyItem, MySelector, and ChildSection.

Definition at line 872 of file Element.cpp.

bool Element::saveIcon ( HICON  myIcon,
wstring  fileDst 
) [static]

Save an HICON into image (PNG,JPG,BMP,GIF).

Definition at line 260 of file Element.cpp.

void Element::sendMsg ( int  wParam,
void *  lParam 
) [static]

Send message to you defined method (EventHandler::messageTreatment).

Definition at line 883 of file Element.cpp.

void Element::setBottom ( int  t  )  [inline]

Definition at line 408 of file SDK_Manila_Sense.h.

static void Element::setGestEvent ( EventHandler val  )  [inline, static]

Definition at line 384 of file SDK_Manila_Sense.h.

void Element::setHeight ( int  t  )  [inline]

Definition at line 406 of file SDK_Manila_Sense.h.

void Element::setLeft ( int  t  )  [inline]

Definition at line 410 of file SDK_Manila_Sense.h.

void Element::setMustRedraw (  )  [virtual]

forcing to redraw

Definition at line 851 of file Element.cpp.

void Element::setRight ( int  t  )  [inline]

Definition at line 409 of file SDK_Manila_Sense.h.

void Element::setTop ( int  t  )  [inline]

Definition at line 407 of file SDK_Manila_Sense.h.

void Element::setWidth ( int  t  )  [inline]

Definition at line 405 of file SDK_Manila_Sense.h.

void Element::sizeChanged ( Element src,
int  width,
int  height 
) [virtual]

This method is called by components when they change size.

Reimplemented in Section, MyEditControl, MyItem, and MyPanel.

Definition at line 969 of file Element.cpp.

virtual void Element::unClick (  )  [inline, virtual]

Reimplemented in MyLabel, MySlider, MyEditControl, MyItem, MySelector, and ChildSection.

Definition at line 415 of file SDK_Manila_Sense.h.

void Element::WriteBMPFile ( HBITMAP  bitmap,
LPTSTR  filename,
HDC  hDC 
)

Used to write HBITMAP into a BMP...


Friends And Related Function Documentation

friend class MessageBoxSense [friend]

Definition at line 310 of file SDK_Manila_Sense.h.


Member Data Documentation

Pointer to GlobalInformations.

Definition at line 361 of file SDK_Manila_Sense.h.

int Element::idElement [protected]

ID used by event handler (You can choose any number).

Definition at line 296 of file SDK_Manila_Sense.h.

bool Element::isActivated [protected]

for button, ctrl, etc...

Definition at line 294 of file SDK_Manila_Sense.h.

can ask for changes

Definition at line 295 of file SDK_Manila_Sense.h.

bool Element::noError = false [static]

Set to true if you don't want error messages "image not found".

Definition at line 352 of file SDK_Manila_Sense.h.

Element which contain this Element.

Definition at line 305 of file SDK_Manila_Sense.h.

int Element::paddingSup [protected]

Definition at line 297 of file SDK_Manila_Sense.h.

RECT Element::position [protected]

the position relative to other components

Reimplemented in MySlider.

Definition at line 292 of file SDK_Manila_Sense.h.

RECT Element::positionAbsolute [protected]

the real position on screen (updated each frame)

Definition at line 293 of file SDK_Manila_Sense.h.

int Element::typeElement [protected]

Definition at line 298 of file SDK_Manila_Sense.h.


The documentation for this class was generated from the following files:
Thibault LELORE