ARX ​​program description (3)

xiaoxiao2021-03-06  84

Chapter 3 Non-geometric Property User Input Interface

Non-geometric attribute user input interfaces are interacting with users in the form of non-modular dialogs, most of why is the form of the drop-down frame to select the setting of the attribute such as wall, door and window, and make users entered the form of the text box. data. The dialog in AutoCAD tries to return to the drawing editing state after the user is entered. Use the Non-Modular dialog box to customize a message function AFX_MSG long onCadkeepfocus (uint, long), and the message function is simple to return to True. Let the dialog still keep the input focus, because each interface has this function, here is introduced in advance, and only his message response is listed, and no explanation will be made. Since the classes describing the various dialogs are inherited from the dialog class CDIALOG class in the MFC class library, each user is introduced.

1, the total input control interface

His interface is shown in Figure 1. In this interface, the user enters the input interface through various function buttons, and various function buttons are global parameter settings, entry, room wall properties setting, room allocation, room control. And the interface returns. In the interface, the user enters the interface after pressing a function button while the total control interface disappears. When the other interface input is completed, return to the total control interface.

MFC class used to describe the control interface is Globeset

Class Linedisplayer: Public CDIALOG

{

// construction

PUBLIC:

Linedisplayer (CWND * PParent = NULL); // Standard Construction Function

// Dialog Data

// {{AFX_DATA (LINEDISPLAYER)

Enum {IDD = IDD_DISPLAYER}; // Dialog Box Resources, user interface resources number

//}} AFX_DATA

Private:

WinRegister * pwintable; // Enter the object pointer to the door window

GLOBESET * PGLOBE; / / Object pointer enters the global setting interface

Winasign * pwinasign; // Object pointer to the door hole setting interface

Roomasign * proomasign; // Object pointer to the room allocation interface

Wallconstruction * PWallStruction; // Object pointer to the wall structure setting interface

ApartControl * PapartControl; // Object pointer to the room control interface

INT Room_index; // Get The SELROOM INDEX

Void Listroom (Room * Pr);

Void fill_combox (); // has been discarded

CODBCDYNAMIC * WINEXPLORE; // has been discarded

// Overrides

// ClassWizard Generated Virtual Function Overrides

// {{AFX_VIRTUAL (LINEDISPLAYER)

protected:

Virtual Void DodataExchange (CDataExchange * PDX); Data and Message Interactive Name

//}} AFX_VIRTUAL

// Implementation

protected:

// generated message map functions

// {{AFX_MSG (Linedisplayer)

AFX_MSG Void OnSerroomChange ();

AFX_MSG Void ONROOMStruct (); Response Wall Structure Settings Function Button

AFX_MSG void onwintable (); Response Door Window Entry Function Button

Virtual Bool OnInitDialog (); Initialization dialog

AFX_MSG Void ONGLOBE (); Response Global Setup Function button

AFX_MSG Void OnWinstruct (); Response Door and Window Structure Settings Function Button

AFX_MSG Void ONROOMASIGN (); Response Room Assignment Function Button AFX_MSG Void OnControl (); Response Site Control Function Button

AFX_MSG void onDone (); final completion message

Declare_eventsink_map ()

//}} AFX_MSG

AFX_MSG Long Onacadkeepfocus (UINT, long);

Declare_message_map ()

}

2, global settings interface

In this class, the global settings of building properties are performed. These global settings include the default building inside and outside wall structure, building floor and ceiling material structure, construction layers, global settings in each layer and high-level characteristics of building levels. . The following is a description of the global MFC class inherited from the dialog class.

Class Globeset: Public CDialog

{

PUBLIC:

GlobeSet (CWND * PParent = null); // Standard Constructionor

Friend class linedisplayer; // The category of the audience and the total input interface is friends.

// Dialog Data

// {{AFX_DATA (GlobeSet)

ENUM {IDD = IDD_GLOBE}; resource ID

CCOMBOBOX M_COM_FLOOR; floor pull-up frame object

CCOMBOBOX M_COM_TOP; ceiling pull-down frame object

CCOMBOBOX M_COM_OUT; exterior wall pull-up frame object

CCOMBOBOX M_COM_IN; inner wall pull-up frame object

INT M_APART_AMOUNT; variables used to record the number of suits

INT M_FLOOR_AMOUNT; variable for recording the number of layers

INT m_floor_height; traversal for recording layer

//}} AFX_DATA

// Overrides

// ClassWizard Generated Virtual Function Overrides

// {{AFX_VIRTUAL (GLOBESET)

protected:

Virtual Bool Create (Linedisplayer * PParentWnd, Uint NID); Creation Function for Non-Modular Dialogs

Virtual Void DodataExchange (CDataExchange * PDX); // Data Exchange

//}} AFX_VIRTUAL

Private:

CODBCDYNAMIC * WINEXPLORE; // Database Hook

LINEDISPLAYER * PPLAYER; Total Function dialog pointer for returning to total functional interface

// Implementation

protected:

// generated message map functions

// {{AFX_MSG (GlobeEt)

Virtual Bool OnInitdialog (); Initialization, Application Database Hook Connect the Material Structure Database in Initialization, select the pull-down box for various structures to select input

AFX_MSG Void OnSelchangefloor (); Response Floor Structure Selection Input

AFX_MSG VOID ONSELCHANGEINWALL (); response inner wall structure selection input

AFX_MSG Void OnSelchangeouterwall (); Response Exterior Wall Structure Selection Input

AFX_MSG VOID ONSELCHANGETOP (); Response ceiling structure selection input

AFX_MSG void onchangeaPartamount (); Response Suit Quantitative Text Input

AFX_MSG void onchangeflooramount (); Response layer text input

AFX_MSG void onchangefloorHeight (); Response layer high text input

AFX_MSG void Onok (); input is completed

//}} AFX_MSG

AFX_MSG Long Onacadkeepfocus (UINT, long); declare_message_map () keeps focus

}

After the global settings are completed, the global settings of the response are saved in the overall variable below:

Winorder Wintable; Door and Window, this global variable is used to record the door window table

Int floor_amount;

INT floor_height; layer high

INT APARTMENT_AMOUNT;

CSTRING IN_CONSTRUCTION; inner wall structure

CSTRING OUT_CONSTRUCTION; exterior wall structure

CSTRING FLOOR_CONSTRUCTION; floor structure

CSTRING TOP_CONSTRUCTION; ceiling structure

3, door and window table entry

This interface is used to entered the door and window table. The door and window specifications in the building are managed by the form of the door and window, which is entered into the door and window table, which is used to set the doors and windows. Below is the definition of the MFC door and window entry:

Class WinRegister: Public CDialog

{

// construction

PUBLIC:

Friend class linedisplayer; Non-named Friends

WinRegister (CWND * PParent = null); // Standard Constructionor

// Dialog Data

// {{AFX_DATA (WinRegister)

ENUM {IDD = IDD_REGISTER}; resource ID

CBUTTON M_WINORDOORCTR; check button object, used to identify whether to input or window

ClistCtrl M_Wintable; Table Object, used to display data entered

CCOMBOBOX M_GLASS_TYPE; window glass type pull-down frame object, display glass to choose

CCOMBOBOX M_DOOR_CONSTRUCT; door structure drop-down object, display door material

INT M_BASE_HIGH; the high record of the window

INT M_HIGH; door hole height

CSTRING M_INDEX; Door and Window Number

CString M_GlasStype; Glass Type

CSTRING M_DOORCONSTRUCT;

INT M_WIDTH;, door hole width

INT M_FRAMEWIDTH; Frame Thickness

Bool M_Winordoor; Boolean variable, used to distinguish between doors or windows

//}} AFX_DATA

Private:

CODBCDYNAMIC * WINEXPLORE; // the dateBase Explore

Linedisplayer * PPlayer; Total interface pointer

CSTRING TYPENAME; Type Name

// Overrides

// ClassWizard Generated Virtual Function Overrides

// {AFX_VIRTUAL (WinRegister)

PUBLIC:

Virtual Bool Create (Linedisplayer * PParentWnd, Uint Nid); create functions

protected:

Virtual Void DodataExchange (CDataExchange * PDX); Data Interaction

//}} AFX_VIRTUAL

// Implementation

protected:

// generated message map functions

// {{AFX_MSG (WinRegister)

AFX_MSG Void Ondelete (); Response Interface Delete Entering Door and Window Data

AFX_MSG VOID ONADD (); Response Door and Window Data Adding Button

Virtual Bool OnInitdialog (); Initialization AFX_MSG Void OnselChangeWintype (); Response Glass Type Selection

AFX_MSG Void OnSelchangeDoorconstruct (); Response Gate Structure Selection

Virtual void onok (); completion

AFX_MSG void onchangeIndex (); Response Number Text Input

AFX_MSG VOID ONSELWIN (); Enter Window Data

AFX_MSG Void OnSetfocusWintype (); Window Type Get Focus

//}} AFX_MSG

Declare_message_map ()

AFX_MSG Long Onacadkeepfocus (uint, long); dialog keeps focus

}

4, wall structure setting interface

In this interface, the user is set to each of the wall structures in the building plane. Since the material structure of various internal and external walls has been set to a default value after the global settings, if the user has to separate a wall The body material structure is arranged, first select the room in which the wall is located, and the various walls selected in AutoCAD are highlighted, and his various walls and their walls are listed in the form. When the user is When a wall is selected in the table, the wall highlights, and a drop-down box appears in the row of the table, allowing the user to make the wall material structure. In this interface, the functionality of the room is set in the kitchen or the bedroom.

Below is the definition of the wall structure to set the MFC class:

Class Wallconstruction: Public CDialog

{

// construction

PUBLIC:

Friend class linedisplayer; Non-named Friends

Wallconstruction (CWND * PParent = null); // Standard Constructionor

Linedisplayer * PPlayer; total function interface pointer

// Dialog Data

// {{AFX_DATA (WallConstruction)

ENUM {IDD = IDD_WALL_CONSTRUCTION}; resource ID

CCOMBOBOX M_ROOMTYPE; room function

CCOMBOBOX M_COM_WALL; wall structure dropped frame object

CCOMBOBOX M_COM_ROOM; room selection pull box object

ClistCtrl M_Wall_List; Wall list object

//}} AFX_DATA

// Overrides

// ClassWizard Generated Virtual Function Overrides

// {{AFX_VIRTUAL (WallConstruction)

protected:

Virtual Bool Create (Linedisplayer * PParentWnd, Uint Nid); create functions

Virtual Void DodataExchange (CDATAEXChange * PDX); Data Interaction T

//}} AFX_VIRTUAL

// Implementation

protected:

// generated message map functions

// {{AFX_MSG (WallConstruction)

Virtual Bool OnInitdialog (); Initialization, mainly initialization of various objects

AFX_MSG VOID ONOK (); completion

AFX_MSG VOID ONSELCHANGEWALLSTRUCT (); Response Wall Material Selection

AFX_MSG Void Onselchangeroom (); Response Room Selection

AFX_MSG VOID ONCLICKWALLLIST (NMHDR * PNMHDR, LRESULT * PRESULT); the wall selection in the response list

AFX_MSG Void OnSelchangeConroomType (); Resident Room Function Set //}} AFX_MSG

AFX_MSG Long Onacadkeepfocus (uint, long); keep focus

Declare_message_map ()

Private:

CODBCDYNAMIC * WINEXPLORE; // The datebase explore database hook

Room * Curroom; // The Current Sel Room Currently selected room

Wall * curwall; currently selected wall

Int selindex; reserved the number of the room

Void FillList (Room * Pr, INT & AMOUNT); Chapter Amount room fill wall list in room linked list

Int walls, roomno; // has been discarded

}

5, door and window structure setting interface

In this interface, the user is set to each door hole. If the window has a sun visor, the sun visor coefficient is input. In this interface, first, users choose to choose the room. If there is a door hole in the wall of the room, the door hole is listed in the list below, when the user selects a door hole in the list, he highlights in AutoCAD, at the same time The drop-down box of the gate window table appears in the second column of the list, and the number of the door and window table entered is listed in the drop-down box and allows the user to select settings. In the table, it also indicates whether the door has a sun visor, and there is a visual display in the coefficient text box below. Users can also set and enter the sun.

Here is the corresponding MFC class definition:

Class Winasign: Public CDIALOG

{

// construction

PUBLIC:

Friend class linedisplayer; Non-named Friends

Winasign (CWND * PParent = NULL);

// Dialog Data

// {{AFX_DATA (Winasign)

Enum {IDD = IDD_WIN_ASIGN}; resource ID

CEDIT M_W_EDIT; Table Coefficient W Enter Object

CEDIT M_D_EDIT; Table Coefficient D Enter Object

CEDIT M_B_EDIT; Table Coefficient B Enter Object

CEDIT M_A_EDIT; Table Coefficient A Enter Object

CListCtrl M_Win_List; Door Cave List Object Input Object

CButton M_HaveOverHang; Is there a sun visor check object

CCOMBOBOX M_COM_INDEX; door window table number drop-down box object

CCOMBOBOX M_COM_ROOM; room pull-up frame object

FLOAT M_HANG_A; Table Coefficient A

Float M_HANG_B; Table Coefficient B

FLOAT M_HANG_D; Table Coefficient D

FLOAT M_HANG_W; Table Coefficient W

Bool M_Checkoverhang; Boolean variable, identify if there is a sun visor

//}} AFX_DATA

// Overrides

// ClassWizard Generated Virtual Function Overrides

// {{AFX_VIRTUAL (Winasign)

protected:

Virtual Bool Create (Linedisplayer * PParentWnd, Uint Nid); create functions

Virtual Void DodataExchange (CDataExchange * PDX); Data Interaction

//}} AFX_VIRTUAL

// Implementation

protected:

// generated message map functions

// {{AFX_MSG (Winasign)

Virtual Bool OnInitdialog (); Initialization

AFX_MSG VOID ONOK (); completion

AFX_MSG Void OnSelchangeComroomwin (); Abandoned AFX_MSG Void OnselendCancelcomwinIndex (); Response Door and Window Number Selection

AFX_MSG Void OnClickwinListwin (NmHDR * PNMHDR, LRESULT * PRESULT); Responding to the choice of door cave in the door

AFX_MSG void onchangehanga (); Input of response to sun visor coefficient a

AFX_MSG void onchangeHANGB (); Input in response to sun visor coefficient B

AFX_MSG void onchangeHangd (); Input of response to the sun visor coefficient D

AFX_MSG void onchangeHangw (); Input of response to the sun visor w

AFX_MSG Void OnhaveOverhang (); Responding to whether there is a sun visor setting

//}} AFX_MSG

Declare_message_map ()

AFX_MSG Long Onacadkeepfocus (UINT, Long); Reserved Input Focus

Private:

Void FillList (int index, room * pr, int & amount); filling the door tag, saved the number of pads in Amount

Linedisplayer * PPlayer; total function interface pointer

Room * SELROOM; Save Select Room Variables

INT WINAMOUNT; the total number of people in the current room

INT SELINDEX; selected door hole number

Winorder * curwin; currently selected door hole

}

6, room allocation interface

The room allocation interface is used to assign a room to the suite, and each room is allocated in this interface. The number of suits in each layer in the architectural design is set, which is used to specify that each room belongs to That set. All rooms are listed in the interface. When the user selects, the drop-down box in the corresponding row appears, and the user is simple to select in the drop-down list to complete the allocation of the room. Finally, users also set up the zone type of the room. When introducing the zone type, the zone type is the class that is the requirements of the clock piano. He also uses the drop-down form to make the user selection, the content of the drop-down box is obtained from the database. Here is the corresponding MFC class definition:

Class Roomasign: Public CDIALOG

{

// construction

PUBLIC:

Friend class linedisplayer; Non-named Friends

Roomasign (CWND * PParent = null); // Standard Constructionor

// Dialog Data

// {{AFX_DATA (Roomasign)

ENUM {IDD = IDD_ROOM_AMIGN}; resource ID

CCOMBOBOX M_COM_APART; Suites drop-down box object

Clistctrl m_room_list; room list object

//}} AFX_DATA

// Overrides

// ClassWizard Generated Virtual Function Overrides

// {{AFX_VIRTUAL (roomasign)

protected:

Virtual Bool Create (Linedisplayer * PParentWnd, Uint Nid); create functions

Virtual Void DodataExchange (CDataExchange * PDX); // DDX / DDV Support

//}} AFX_VIRTUAL

// Implementation

protected:

// generated message map functions

// {{AFX_MSG (Roomasign)

Virtual Bool OnInitdialog (); Initialization

AFX_MSG VOID ONCLICKLIST1 (NMHDR * PNMHDR, LRESULT * PRESULT); Response Room Select AFX_MSG VOID ONOK (); completion

AFX_MSG Void OnSelchangeComaPArtment (); Response Suites Selection

//}} AFX_MSG

Declare_message_map ()

AFX_MSG Long Onacadkeepfocus (uint, long); keep focus

Private:

Linedisplayer * PPlayer; total function interface pointer

INT SELINDEX; selected room number

Room * SELROOM; selected room pointer

INT selapartment; selected suite number

}

The class regarding the suite control is written by Zhongqin, I only provide a function button.

The total interface is finally the completion button. When this button is pressed, the program is completed.

转载请注明原文地址:https://www.9cbs.com/read-107278.html

New Post(0)