githubEdit

Property Sheet Control Class

Brief Introduction to Property Sheet Control Class

Property Sheet control class is composed of independent property pages, and each property page has a tongue. We can click the tongue to switch between different property pages. The property pages here are the page controls that can accommodate other controls. We usually use the method similar to establishing dialog box, which is the method of defining the dialog box template, to add property page to the property sheet.

The most common purpose of property sheet control class is placing interaction content of different categories into the same dialog box by category, and displaying different content through category switch. On the one hand, it saves the space of dialog box, on the other hand, it makes it easier to use the interaction interface.

The class inheritance relation of the window and its derived class is as follows:

mPropSheet

  • Control name: NCSCTRL_PROPSHEET

  • English name: PropSheet

  • Brief introduction: It is composed of multiple independent property pages. Each property page has a tongue, and switching between the property pages are carried out through the tongue.

  • Schematic diagram:

alt

Style of mPropSheet

It is inherited from the style of mWidget.

Style name

miniStudio property name

Explanation

NCSS_PRPSHT_SIMPLE

style->Simple

Style of controlling the tongue width of the property page: tongues of all the property pages have the same width.

NCSS_PRPSHT_COMPACTTAB

style->Compact

Style of controlling the tongue width of the property page: tongue width of the property page is decided by the length of the title text of the property page.

NCSS_PRPSHT_SCROLLABLE

style->Scrollable

Style of controlling the tongue width of the property page: tongue width of the property page is decided by the length of the title text of the property page. When there are too many property page tongues, left and right arrows will automatically appear to adjust the currently visible property page tongue.

NCSS_PRPSHT_TOP

TabPos->Top

Style of controlling the display direction of the property page tongue in the property sheet: property page tongue is displayed on the top of the property sheet.

NCSS_PRPSHT_BOTTOM

TabPos->Bottom

Style of controlling the display direction of the property page tongue in the property sheet: property page tongue is displayed on the bottom of the property sheet.

Property of mPropSheet

It is inherited from the property of mWidget.

Property ID

miniStudio name

Type

Authority

Explanation

NCSP_PRPSHT_MINTABWIDTH

TabMinWidth

int

RW

Minimum width of the tongue

NCSP_PRPSHT_TABMARGIN

TabMargin

int

RW

Tongue boundary value. Under normal condition, the value plus the literal width is the tongue width

NCSP_PRPSHT_ACTIVEPAGE

-

mPage*

RW

Pointer of the current active page

NCSP_PRPSHT_ACTIVEPAGEIDX

ActivePageIndex

int

RW

Index of the current active page

NCSP_PRPSHT_FIRSTVIEWPAGE

-

mPage*

RO

Pointer of the currently first visible page

NCSP_PRPSHT_FIRSTVIEWPAGEIDX

-

int

RO

Index of the currently first visible page

NCSP_PRPSHT_PAGECOUNT

-

int

RO

Current property page number

Event of mPropSheet

It is inherited from the event of mWidget.

Event ID

Parameter

Explanation

NCSN_PRPSHT_ACTIVECHANGED

--

The active property page has changed

Method of mPropSheet

It is inherited from the method of mWidget.

Add property page

After creating property sheet control, property page can be added to the property sheet through addPage method. dlgTemplate of the method is used to transfer dialog box template, and handlers is used to transfer event callback handling function of the property page. Prototype of the function is as below:

As shown in the Instance program, the codes below are utilized to add multiple property pages to the property sheet control:

Events of the property pages are handled as:

Remove the Property Page

To remove certain property page, it is only necessary to call the removePage or removePageByIndex method of the property sheet control. It needs to be noted that after a property page is removed, it may change the index value of other property pages. removePage removes the appointed page through the class pointer of the property page, and removePageByIndex removes the appointed page through property page index.

Prototype of the function is as below:

If you want to remove the first property page in the property sheet, you can implement the following operation:

Index Property Page

To get the index page class pointer of the appointed index, it is necessary to call getPageByIndex method of property sheet control; while to get index of certain appointed property page, it is only necessary to call getPageIndex method of property sheet control. Prototype of the function is as below:

Such as get index of the appointed property page:

Or get the class pointer of the first property page, and then operate the property page through the method of mPage control:

Traverse Property Page

In the property sheet control, traversal find function to all the property pages can be realized through getNextPage and getPrevPage method. getNextPage is used to traverse property pages from the appointed property page towards the back; getPrevPage is used to traverse the property pages from the appointed property page towards the front.

For example:

Broadcast Message

Property sheet control can broadcast message to all the property pages through broadCastMsg method. Content of the message is transmitted through param1 and param2. When the property sheet control receives non null value returned by any property page after handling the broadcast message, the returned value of the property sheet will plus one for the index value of the property page with message broadcasting interrupted. Through this method, function operations such as invalid input processing etc. can be realized.

Renderer of mPropSheet

It is inherited from the renderer of mWidget.

Instance of mPropSheet

This Instance demonstrates how to use propsheet to display some system information of the computer to the users, such as CPU type and memory size etc.

alt

Figure 1 Output of propsheet Program

List 1 propsheet.c


<< Progress Bar Control Class | Table of Contents | Edit Box and Derived Classes >>

Last updated