githubEdit

Invisible Control Class

Brief Introduction to Invisible Control Class

Invisible control refers to the components which cannot be displayed on the window but have certain functions.

These components is encapsulation to some functional templates, guaranteeing that they can be edited in miniStudio like control

  • mObject

    • mComponent

      • mInvsbComp

mInvsbComp

  • Control name: None

  • English name: Invisible Component

  • Brief introduction: Basic class of invisible component

  • Schematic diagram: Foundation class, cannot be used directly

Style of mInvsbComp

It is inherited from the style of mComponent.

Property of mInvsbComp

It is inherited from the property of mComponent.

Method of mInvsbComp

mInvsbComp provides realization of the following methods:

  • setId

  • getId

  • setReleated

  • getReleated

  • getChild

In addition, for the convenience of use of mInvsbComp, the following functions are provided

  • Create invisible component

NCS_INVSB_CREATE_INFO structure used by function ncsCreateInvsbCompIndirect is defined as below:

Note that it is not encouraged to directly use the function to create invisible component, and they have no advantage in handwritten codes. The advantage is that resources provided by miniStudio can be utilized to load.

So example is omitted.

Event of mInvsbComp

It is inherited from the event of mComponent.

mTimer

  • Control name: NCSCTRL_TIMER

  • English name: Timer

  • Brief introduction: Encapsulation to MiniGUI SetTimerEx and KillTimer

alt

Inheritance relationship:

  • mObject

  • mComponent

    • mInvsbComp

    • mTimer

Style of mTimer

It is inherited from the style of mInvsbComp.

Property of mTimer

It is inherited from the property of mInvsbComp.

Property ID

miniStudio name

Type

Authority

Explanation

NCSP_TIMER_INTERVAL

interval

DWORD

RW

Set time interval of Timer, with 10ms as the unit. If Timer is operating, it will restart Timer

Method of mTimer

It is inherited from the method of mInvsbComp.

  • start

  • Start Timer

  • Return TRUE for start successful, FALSE for start failed.

  • stop

  • Stop the timer in operation

  • getParent

  • Get the window with Timer

Event of mTimer

It is inherited from the event of mInvsbComp.

Event notification code

Explanation

Parameter

MSG_TIMER

Directly utilize the definition of MiniGUI

Total time amount that timer walks by, which is lParam value of MSG_TIMER

  • Note that the callback of the event is:

  • Return TRUE to continue Timer, FALSE to stop Timer

  • Params

    • DWORD total_count - Total time amount since Timer starts

Example of mTimer

The example below demonstrates using timer to show a digital clock, and the operation effect drawing is as below:

alt
  • Declare Timer uses the same structure as the control

  • Initialize Timer, establish a connection with Static control, and start Timer

  • When MSG_TIMER event occurs, update the time

For complete code, refer to the following List.


<< Other Advanced Control Classes | Table of Contents | Other Classes >>

Last updated