mGNCS API Reference  v1.5.0
A new control set and a new framework for MiniGUI apps
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
mWidget

Data Structures

struct  mWidgetRenderer
 Widget class's Renderer interface. More...
 
struct  mWidget
 define the mWidget members, inherit from mComponent More...
 
struct  mWidgetClass
 the VTable of mWidget, drived from mComponentClass More...
 

Macros

#define NCSCTRL_WIDGET   NCSCLASSNAME("widget")
 the name of widget control More...
 
#define NCSR_CONTINUE_MSG   FALSE
 return value, pass the message to the default window process More...
 
#define NCSR_STOP_MSG   TRUE
 return value, return directly, don't pass the message to default window process More...
 
#define NCS_NOTIFY_CODE(code)   (0xFFFF0000 | (code))
 
#define NCS_MAP_NOTIFY(code, handler)   { NCS_NOTIFY_CODE(code), (void*)(handler) }
 

Typedefs

typedef struct _NCS_WND_TEMPLATE NCS_WND_TEMPLATE
 
typedef void(* NCS_CB_ONNCCREATE) (mWidget *)
 the Callback of Event MSG_NCCREATE, which is the first message of a control More...
 

Enumerations

enum  ncsRendererState {
  NCSRS_NORMAL = 0x00, NCSRS_HIGHLIGHT = 0x01, NCSRS_SIGNIFICANT = 0x02, NCSRS_SELECTED = 0x04,
  NCSRS_HALFSELECTED = 0x10, NCSRS_DISABLE = 0x08
}
 define the renderer state of widget More...
 
enum  ncsRendererFlag { NCSRF_INNERFRAME = 0x010000, NCSRF_FILL = 0x020000, NCSRF_FRAME = 0x040000 }
 the flag defines of renderer More...
 
enum  ncsRDRArrow { NCSR_ARROW_LEFT = 0, NCSR_ARROW_RIGHT, NCSR_ARROW_UP, NCSR_ARROW_DOWN }
 the arrow define of renderer More...
 
enum  mWidgetProp {
  NCSP_WIDGET_RDR = 1, NCSP_WIDGET_TEXT, NCSP_WIDGET_BKIMAGE, NCSP_WIDGET_BKIMAGE_MODE,
  NCSP_WIDGET_BKIMAGE_FILE
}
 the properties id of mWidget More...
 
enum  mWidgetNotify { NCSN_WIDGET_CLICKED = 1, NCSN_WIDGET_DBCLICKED, NCSN_WIDGET_ENABLED, NCSN_WIDGET_DISABLED }
 the notification code of mWidget More...
 

Functions

void mWidget_captureHotPiece (mWidget *self, mObject *hotpice)
 

Variables

MGNCS_EXPORT mWidgetClass g_stmWidgetCls
 the instance of mWigetClass More...
 

Detailed Description

Macro Definition Documentation

◆ NCS_MAP_NOTIFY

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

Map a notification event into a handler

Definition at line 776 of file mwidget.h.

◆ NCS_NOTIFY_CODE

#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 771 of file mwidget.h.

◆ NCSCTRL_WIDGET

#define NCSCTRL_WIDGET   NCSCLASSNAME("widget")

the name of widget control

Definition at line 79 of file mwidget.h.

◆ NCSR_CONTINUE_MSG

#define NCSR_CONTINUE_MSG   FALSE

return value, pass the message to the default window process

See also
NCSR_STOP_MSG

Definition at line 504 of file mwidget.h.

◆ NCSR_STOP_MSG

#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 512 of file mwidget.h.

Typedef Documentation

◆ NCS_CB_ONNCCREATE

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 524 of file mwidget.h.

◆ NCS_WND_TEMPLATE

See also
_NCS_WND_TEMPLATE

Definition at line 88 of file mwidget.h.

Enumeration Type Documentation

◆ mWidgetNotify

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 468 of file mwidget.h.

◆ mWidgetProp

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 396 of file mwidget.h.

◆ ncsRDRArrow

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 178 of file mwidget.h.

◆ ncsRendererFlag

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 156 of file mwidget.h.

◆ ncsRendererState

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 116 of file mwidget.h.

Function Documentation

◆ mWidget_captureHotPiece()

void mWidget_captureHotPiece ( mWidget self,
mObject hotpice 
)

public static function

Variable Documentation

◆ g_stmWidgetCls

g_stmWidgetCls

the instance of mWigetClass

See also
mWidgetClass