mWidget

Data Structures

Defines

Typedefs

Enumerations

Functions

Variables


Define Documentation

#define NCS_MAP_NOTIFY ( code,
handler   )     { NCS_NOTIFY_CODE(code), (void*)(handler) }

Map a notification event into a handler

Definition at line 743 of file mwidget.h.

#define NCS_NOTIFY_CODE ( code   )     (0xFFFF0000 | (code))

Add a speical flags into a notification code, so that the NCS can distinguish notification events from message events

Definition at line 738 of file mwidget.h.

#define NCSCTRL_WIDGET   NCSCLASSNAME("widget")

the name of widget control

Definition at line 46 of file mwidget.h.

#define NCSR_CONTINUE_MSG   FALSE

return value, pass the message to the default window process

See also:
NCSR_STOP_MSG

Definition at line 471 of file mwidget.h.

#define NCSR_STOP_MSG   TRUE

return value, return directly, don't pass the message to default window process

See also:
NCSR_CONTINUE_MSG

Definition at line 479 of file mwidget.h.


Typedef Documentation

void(* NCS_CB_NOTIFY)(mWidget *, int id, int ncCode, DWORD param)

the callback of all notification event

Parameters:
mWidget * the sender pointer
ncCode the notification code of event
param the param of notify message

Definition at line 730 of file mwidget.h.

BOOL(* NCS_CB_ONCLOSE)(mWidget *)

the callback of event MSG_CLOSE

Parameters:
mWidget* the sender pointer
Returns:
NCSR_CONTINUE_MSG, NCSR_STOP_MSG

Definition at line 619 of file mwidget.h.

BOOL(* NCS_CB_ONCMD)(mWidget *, int id, int nc, HWND hCtrl)

the callback of event MSG_COMMAND

Parameters:
mWidget* the sender pointer
id the child(control or menuitem) id
nc the notification code of child
hCtrl the child's handle ( or 0 if child is a menuitem)
Returns:
NCSR_CONTINUE_MSG, NCSR_STOP_MSG

Definition at line 698 of file mwidget.h.

BOOL(* NCS_CB_ONCREATE)(mWidget *, DWORD dwAddData)

the callback of event MSG_CREATE

Parameters:
mWidget * the event sender's pointer
dwAddData the additional data when create this window, passed by ncscreatewindow, ncscreatewindowindirect, ncscreatemainwindow ncscreatemainwindowindirect
Returns:
True - allow NCS create control continue; FALSE - abort the creating
See also:
ncsCreateWindow, ncsCreateWindowIndirect, ncsCreateMainWindow, ncsCreateMainWindowIndirect

Definition at line 507 of file mwidget.h.

void(* NCS_CB_ONCSZCHGED)(mWidget *, int clientWidth, int clientHeight)

the callbace of event MSG_CSIZECHANGED

This is the last message when changing a widget bounds

Parameters:
mWidget * sender pointer
clientWidth the new width of sender's client
clientHeight the new height of sender's client

Definition at line 574 of file mwidget.h.

BOOL(* NCS_CB_ONERASEBKGND)(mWidget *, HDC hdc, const PRECT clip)

the callback of event MSG_ERASEBKGND

Parameters:
mWidget * the sender pointer
hdc the DC of background, hdc may be 0, so you shoud check it, and call GetClientDC or GetDC when hdc == 0
clip the area should to be erased. clip may be equal NULL, so, call GetWindowRect, or GetClientRect when clip == NULL
Returns:
NCSR_CONTINUE_MSG, NCSR_STOP_MSG

Definition at line 600 of file mwidget.h.

BOOL(* NCS_CB_ONFONTCHGING)(mWidget *, PLOGFONT logFont)

the callback of event MSG_FONTCHANGING

This event is called when SetWindowFont is called

Parameters:
mWidget * then sender pointer
logFont the logic font would be set to sender
Returns:
TRUE - tell the SetWindowFont continue set the font, FALSE - abort SetWindowFont

Definition at line 587 of file mwidget.h.

int(* NCS_CB_ONHITTEST)(mWidget *, int message, int x, int y)

the callback of events MSG_HITTEST MSG_NCHITTEST

Parameters:
mWidget * the sender pointer
message the event code
x the x-coordinate of hit point
y the y-coordinate of hit point
Returns:
int hit code

Definition at line 675 of file mwidget.h.

BOOL(* NCS_CB_ONINITDLG)(mWidget *, HWND hFocus, DWORD dwAddData)

the callback of event MSG_INITDIALOG, only valid in mDialogBox, when a dialog is created

Parameters:
mWidget * the sender pointer of event
hFocus the focus window when dialog is created
dwAddData the additional data passed by ncscreatewindow, ncscreatewindowindirect, ncscreatemainwindow ncscreatemainwindowindirect
Returns:
True - allow dialog continue; FALSE - abort the dialog
See also:
ncsCreateWindow, ncsCreateWindowIndirect, ncsCreateMainWindow, ncsCreateMainWindowIndirect

Definition at line 522 of file mwidget.h.

BOOL(* NCS_CB_ONKEY)(mWidget *, int message, int code, DWORD keyStatus)

the callback of event MSG_KEYDOWN MSG_KEYUP MSG_CHAR MSG_SYSKEYDOWN MSG_SYSKEYUP MSG_SYSCHAR

Parameters:
mWidget * the sender pointer
message event code, distinguish the events
code the scancode (MSG_KEYDOWN MSG_KEYUP MSG_SYSKEYDOWN MSG_SYSKEYUP) or ascii code (MSG_CHAR MSG_SYSCHAR)
keyStatus The shift key status when this message occurred
Returns:
NCSR_CONTINUE_MSG, NCSR_STOP_MSG

Definition at line 634 of file mwidget.h.

BOOL(* NCS_CB_ONMOUSE)(mWidget *, int message, int x, int y, DWORD keyStatus)

the callback of events MSG_LBUTTONDOWN MSG_LBUTTONUP MSG_LBUTTONDBCLK MSG_MOUSEMOVE MSG_RBUTTONDOWN MSG_RBUTTONUP MSG_RBUTTONDBCLK

Parameters:
mWidget * sender pointer
message the event code
x the x-coordinate of mouse
y the y-coordinate of mouse
keyStatus The shift key status when this message occurred.
Returns:
NCSR_CONTINUE_MSG, NCSR_STOP_MSG

Definition at line 649 of file mwidget.h.

int(* NCS_CB_ONMSG)(mWidget *, int message, WPARAM wParam, LPARAM lParam)

the callback of a common message event

Parameters:
mWidget * sender pointer
message the event code
wParam the wParam of message event
lParam the lParam of message event
Returns:
int - this value will be as the finally return value of event, and none default processing would be called

Definition at line 720 of file mwidget.h.

typedef void(* NCS_CB_ONNCCREATE)(mWidget *)

the Callback of Event MSG_NCCREATE, which is the first message of a control

Parameters:
mWidget* the event sender's pointer
Returns:
none

Definition at line 491 of file mwidget.h.

BOOL(* NCS_CB_ONNCMOUSE)(mWidget *, int message, int x, int y, int hitCode)

the callback of events MSG_NCLBUTTONDOWN MSG_NCLBUTTONUP MSG_NCLBUTTONDBCLK MSG_NCMOUSEMOVE MSG_NCRBUTTONDOWN MSG_NCRBUTTONUP MSG_NCRBUTTONDBCLK

Parameters:
mWidget * the sender pointer
message the event code
x the x-coordinate of mouse
y the y-coordinate of mouse
hitCode the hit code
Returns:
NCSR_CONTINUE_MSG, NCSR_STOP_MSG

Definition at line 663 of file mwidget.h.

void(* NCS_CB_ONPAINT)(mWidget *, HDC hdc, const PCLIPRGN clip_rgn)

the callback of event MSG_PAINT

Parameters:
mWidget * sender pointer
hdc the DC for painting
clip_rgn invlidate region

Definition at line 610 of file mwidget.h.

void(* NCS_CB_ONSCROLL)(mWidget *, int message, int code, int pos)

the callback of events MSG_HSCROLL , MSG_VSCROLL

Parameters:
mWidget * the sender pointer
message the event code
nc the scrolling code, see MSG_HSCROLL and MSG_VSCROOL in MiniGUI

Definition at line 686 of file mwidget.h.

BOOL(* NCS_CB_ONSZCHGED)(mWidget *, PRECT prcClient)

the callback of event MSG_SIZECHANGED

This callback is called after a widget's bound changed if you want change the client size of the sender, reset the prcClient

Parameters:
mWidget * the sender pointer
prcClient IN & OUT param, the client bound of the sender
Returns:
TRUE - the prcClient is changed, FALSE - prcClient is not changed

Definition at line 561 of file mwidget.h.

void(* NCS_CB_ONSZCHGING)(mWidget *, const PRECT prcExpect, PRECT prcResult)

the callback of event MSG_SIZECHANGING, when a widget's bound is changing. If you want change the widget bounds, set the prcResult, by default, copy prcExpect to prcResult

Parameters:
mWidget * the sender pointer
prcExpect the excepted bound, IN param
prcResult the resulted bound, OUT param,

Definition at line 546 of file mwidget.h.

BOOL(* NCS_CB_ONVOID)(mWidget *, int message)

the callback of events MSG_ACTIVE MSG_FONTCHANGED MSG_KEYLONGPRESS MSG_KEYALWAYSPRESS MSG_DESTROY

Parameters:
mWidget * the pointer of sender
message the event code, indicate the event
Returns:
NCSR_CONTINUE_MSG, NCSR_STOP_MSG except MSG_DESTROY, the return value woulbe be ignored

Definition at line 534 of file mwidget.h.

void(* NCS_CB_WIDGET_ONTIMER)(mWidget *, int id, DWORD count)

the callback of event MSG_TIMER

Parameters:
mWidget* the sender pointer
id the id of timer
count the total tick count of timer

Definition at line 707 of file mwidget.h.

See also:
_NCS_WND_TEMPLATE

Definition at line 55 of file mwidget.h.


Enumeration Type Documentation

the notification code of mWidget

Enumerator:
NCSN_WIDGET_CLICKED 

send by a widget is cliced by left button

NCSN_WIDGET_DBCLICKED 

send by a widget is double cliced by left button

NCSN_WIDGET_ENABLED 

send by a widget is enabled

NCSN_WIDGET_DISABLED 

send by a widget is disabled

Definition at line 435 of file mwidget.h.

the properties id of mWidget

Enumerator:
NCSP_WIDGET_RDR 

Set the renderer class name

  • Type : const char*
  • WriteOnly
  • Repaint all the control.
NCSP_WIDGET_TEXT 

Set the widget 's text, same as SetWindowText

  • Type : const char*
  • WritedOnly
  • Repaint the text of widget.
NCSP_WIDGET_BKIMAGE 

Set the widget's back image

  • Type : PBITMAP
  • ReadWirte
  • Repaint the background when set it.
NCSP_WIDGET_BKIMAGE_MODE 

Set the widget's back image mode

  • Type : int
    • NCS_DM_NORMAL
    • NCS_DM_SCALED
    • DrawMode_Title
  • ReadWrite
  • Repaint the background when set it.
NCSP_WIDGET_BKIMAGE_FILE 

Set the widget's back image from file

  • Type : const char*, file name of image
  • WriteOnly
  • Repaint the background when set it.
Note:
widget will load a PBITMAP from the file, and release it automatically

Definition at line 363 of file mwidget.h.

the arrow define of renderer

Enumerator:
NCSR_ARROW_LEFT 

indiate a left arrow

NCSR_ARROW_RIGHT 

indiate a right arrow

NCSR_ARROW_UP 

indiate a up arrow

NCSR_ARROW_DOWN 

indiate a down arrow

Definition at line 145 of file mwidget.h.

the flag defines of renderer

Enumerator:
NCSRF_INNERFRAME 

indicate that draw a inner frame box or shape

NCSRF_FILL 

indicate that fill a box or other shape

NCSRF_FRAME 

indicate that draw a box or other shape with a frame

Definition at line 123 of file mwidget.h.

define the renderer state of widget

Enumerator:
NCSRS_NORMAL 

normal state

NCSRS_HIGHLIGHT 

higlight state

NCSRS_SIGNIFICANT 

significant state

NCSRS_SELECTED 

a box or item is selected

NCSRS_HALFSELECTED 

half selected state

NCSRS_DISABLE 

disable state

Definition at line 83 of file mwidget.h.


Function Documentation

void mWidget_captureHotPiece ( mWidget self,
mObject hotpice 
)

public static function


Variable Documentation

the instance of mWigetClass

See also:
mWidgetClass
Generated on Fri Jun 10 11:18:07 2011 for New Control Set V1.0.0 API Reference by  doxygen 1.6.3