GacUI Learning (1), GacUI Learning (

Source: Internet
Author: User

GacUI Learning (1), GacUI Learning (
GacUI Learning (1) high imitation system notepad (1)

Reprinted please indicate Source: http://www.cnblogs.com/lyfh/p/6107215.html

GacUI is a cross-platform C ++ conversion UI library carefully developed by wheel brother (vczh), including the C ++ skill of wheel brother. For GacUI, wheel brother has written Chinese tutorials and Demos. The tutorial address is https://segmentfault.com/a/119004264055577. democan go to its blog to read the tutorials.

This program is expanded based on "GacUI Demo: basic text box application" and is compatible with the subsequent text box highlight series. Not to mention, first (this figure shows the main interface of notepad with the text box height function. The highlighted mode is determined by the highlighted mode on the status bar ):

GacUI contains a wide range of typographical functions. For details, see the topic "basic concepts of GacUI (2) -- typographical (1)" and "basic concepts of GacUI (2) -- typographical (2). This program uses the GuiTableComposition of the three rows and one column in the outermost layer for layout, and then one GuiCellComposition in each row. Then, the control is arranged in GuiCellComposition. The procedure is as follows:

First, create a TextBoxEditorWindow class inherited from vl: presentation: controls: GuiWindow. As the basic window, all typographical layout and control operations will be performed in this window. The TextBoxEditorWindow constructor is as follows:

1 TextBoxEditorWindow::TextBoxEditorWindow() : GuiWindow(GetCurrentTheme()->CreateWindowStyle())                                            2 {3     this->SetText(TEXT("GacTextBox"));4     this->GetContainerComposition()->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren);5     this->SetClientSize(Size(888, 679));6 }

 

Create a table in the constructor to layout the table.

1/* 2 layout uses three rows and one column form; 3 rows and one column form; 1: menu bar; 4 rows; 2: Edit column; 5 rows of text; 3: status bar, display status information such as row number 6 */7 GuiTableComposition * table = new GuiTableComposition; 8 table-> SetAlignmentToParent (Margin (0, 0, 0, 0 )); 9 table-> SetCellPadding (2); 10 table-> SetRowsAndColumns (3, 1); 11 table-> SetRowOption (0, GuiCellOption: MinSizeOption ()); 12 table-> SetRowOption (1, GuiCellOption: PercentageOption (1.0); 13 table-> SetRowOption (2, GuiCellOption: MinSizeOption ()); 14 table-> SetColumnOption (0, GuiCellOption: PercentageOption (1.0); 15 this-> GetContainerComposition ()-> AddChild (table );

 

These lines of code set a series of table attributes, for specific significance, see GacUI document http://gaclib.net/Document.html #~ /. The focus is on the last row. Add the table to TextBoxEditorWindow. The rest is to create corresponding controls in each cell of the table.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.