[C ++] A true C ++ Builder System Code Specification Document

xiaoxiao2021-03-06  43

GT80 ​​front-end programming specification (grass) one. Interface specification. 1. Principle:. Simple, simple, unified, practical, and convenient. 2. Screen resolution: Unified 800 * 600.3. Form:. Do not support maximumization and minimization, no size change (BorderStyle is BSDIALOG or BSSINGLE). Location is in general, or use code to achieve. The location of the selection form that pops up in the user's operation should be based on the current focus to avoid a large transfer of the user's visual focus. 3. Color:. In addition to special circumstances, the color of a screen should not exceed three,. Use CLBLACK, Clnacy, CLTEAL, CLGRAY and other cold colors, and use CLRED, CLGREEN, CLBLUE, CLYELLOW, etc., etc. (to reduce Users visual stimulation). Colors of standard controls such as Button use the system color. 4. Font:. Try to use the Song No. 12 Standard Font (Chinese and English), and Times New Roman font (English, numbers). Bold, tilted, underscore, etc. 4. Help: Try not to have a complicated operating instructions on the screen, use the Help button to call out detailed operating instructions or use the Hint and Showhint properties of the control. 5. Hotkeys: F1 ---- Help F2 ---- Confirmation, Deposit F4 ---- Modify F8 ---- Print F9 ---- Record, Return, Next PGUP ---- Multi-page forward page PGDN ---- Multi-page backward-page ESC ---- Exit, give up the rest of the function keys for mobile, try to make one screen's function hotkey is on the keyboard At least one key or in different areas, such as using: F2, F4, F5, F8, F9 key. 6. Keyboard Support:. All functions of the front desk, background common functions, and the function of the user's input requirements, the function of the real-time response should fully support the keyboard, input, select the mobile between the focus of the control must support the return, up and down arrows, if you need to input The complex form of the response, the response code should be written in the keydown, change, etc., and the focus of Tab, Shift-Tab is not allowed. If each control is arranged laterally, the movement of the left and right arrow keys (Edit's left and right arrow keys can also be implemented, see the source code of [reception | business query | real-time entrustment query]). The page page of the .page control must support the PGUP and PGDN keys. If focus is on controls such as ListView, StringGrid, you must support the page pages of Alt - PGUP, Alt-PGDN. The result of the multi-page query cannot be lost due to page pages, and the re-query of any page must be carried out with a hotkey or mouse such as F9. Only the form of the keyboard should be used to enter the mouse before entering the mouse before returning, and the RESTORECURSOR () function is used to restore the mouse. Or conduct corresponding inspections in the program to avoid users using the mouse to exception or misuse. 7. Focus control:. The form does not appear in any case. The focus is moving with the business specification, the screen layout is based on the business specification, the main principle is to make the user feel convenient and fast. When focus is in ListView, ListBox, Checklistbox, at least the control in the control is selected and the rows selected when exiting the control should be selected when re-entering the control. 8. Display of the results of the query:. The number of fixed query can be displayed using Label, StaticText (Note Align, Spacing).

. Quantity Dynamic query results can be displayed using listview, stringgrid, etc.: ListView -> Coded simple, but the speed is slow StringGrid -> encoded complicated in large data volume, but suitable for large data volume - try to make controls as much as possible The screen space does not cause a horizontal scroll bar. - After the query results come out, the focus should be moved to the results control unless the user uses the mouse or hotkey, otherwise the result control is not lost (such as when the arrow key is pressed when the first line of the results control is selected to move the focus to the last one. Condition input control, pressing the arrow keys to move the focus to the print button when the final line is selected. - The multi-page query result cannot be lost due to switching between the page, that is, when the query result of a page comes out, the user switches to another page, then switch back to this page, the query result of this page should still be displayed. - After the query result of the multi-page query, when the user is switched to this page again, if there is a query, the results control should be focused. If no query results, the focus should be maintained or moved to the first condition input control. - When there is a logical upper limit for the results of the query, there is no limit to the number of results, such as the balance of securities, capital balance, and the basic data browsing, etc.), and the logically unimplete query, such as historical queries, etc., the upper limit of the number of lines should be specified. (Such as 1000), avoid the rear negative ambient overweight or the front end speed slowly crash. In principle, it is no longer like GT7.0 to pages. Example of multi-page query See [Front desk | Business Query | History Inquiry]. 9. Control for a particular control. When comboBOX- is in a non-drop state, press the arrow key to pull the space button to switch the drop-down status - Enter the button to exit .EDitbox- on the arrow key focus to move to the last control - down arrow keys, Enter the focus Move to the next control - When the control is arranged laterally, the focus of the left and right arrow keys can be supported. ListView - Select a row pressing a carriage return or a mouse Double-click to select the second. Coding Standards. 1. Principle: It is simple, meaning and clear, and it is easy to find. Try to use Pinyin and English (if English can also be used in English) or pinyin mixed with English.

Such as: ed_khzl -> Enter customer information editbn_ensure -> Confirm ButtonCB_Market -> Select Market's ComboBoxzhzj_accessFund -> Customer, Fund Management Capital Access Module Unit F_WTGL_BULKWT -> Delegate Management Bulletin Table 2. Unit File Name: Ordinary Rules - The sub-module name _ unit name public unit - G_ unit name is all upper capital, cell name case mix, such as: zhzj_addacc -> Customer fund management customer account access module YYCX_SSWTCX -> Business inquiry real-time Entrusted Query Module G_COMM -> COMM Unit G_GetAccount-> Enter Customer Data Universal Unit 3. Form Name: Normal Rules - F_ A submodule name _ unit name (F_ Unit File Name) Public Unit - F_G_ Unit Name A submodule All uppercase, unit name case mix, such as: f_zhzj_addacc -> Customer fund management customer account opening capital access module form f_yycx_sswtcx -> business inquiry real-time entrustment query module form f_g_getaccount-> Enter customer data General Form 4. Control Name: Rule : All lowercase control prefix Button, Bitbtn -> BN_ Edit, Maskedit, Multimaskedit -> Ed_ Label -> L_ StaticText -> ST_ Menu, Popmenu -> M_ MEMO -> MO_ Checkbox, ComboBox, ChecklistBox-> CB_ Radiobox -> RB_ listbox -> LB_ Groupbox -> GB_ RadioGroup -> rg_ Panel -> pn_ StringGrid, TWStringGrid -> sg_ ListView, TWListView -> lv_ Image -> img_ TabControl -> tab_ PageControl -> pg_ ImageList -> imgl_ ProgressBar -> pb_ Animate -> am_ TreeView -> tv_ StatusBar -> SB_ Timer -> TI_ CGAUGE -> CG_ OPENDIALOG -> OD_PRINTDIALOG ->

Controls involved in the PD_ code, such as prompt Label, can use the default names of the system, such as the Label1, Label2 ... form, such as Animate, can only use prefix (remove downline), such as AM, The rest of the controls must be named using the [prefix intentional suffix name]. For the controls in the multi-page, the controls in each page, it is best to name the [Prefix TabControl Suffix Name meaningful suffix name] to avoid confusion with the controls on other pages. 5. Form Design: All non- The main form is created with new (), with ShowModal (), with the Cancel property to True, Modalresut is non-mrnone's exit Buttuon exit (hotkey ESC) or writing CLOSE () exits, it is recommended to use the former. Delete with delete (). The initialization of forms is performed in Create, show events. The general principle is that the interface is adjusted in Show, SQL calls, and the remaining non-visual controls are created in CREATE. If the SQL call is time consuming, it is recommended to display an animation waiting window (see F_ANMI_WAIT and F_JG_SINGLEJG forms at the front desk). The initialization of the variable is done in the constructor or CREATE event of the form. The non-visual control created in the form of the form is deleted in the DELETE () in the Destory event in the Dessert event in the Create event of the form. It is recommended to give a PUBLIC member NeedShow (INT or BOOL) to determine if the form should be displayed. For example, if the SQL call error in Create, the information box is displayed, and the NEEDSHOW is 5 after FALSE, indicating that the form should not be displayed. The introduction of form information uses the constructor or global variable of the overloaded form to use the previous public member or global variable to use the former.

A typical menu code (form creation, display, deletion) is as follows: tf_example_form * form = new tf_example_form (application); if (form-> needshow) Form-> showModal (); delete form; a typical information incoming The code is as follows: // Enter the Securities Pinyin to use Ed_zqdm Let the user choose this short-handed securities #define Shenzhen 0 int market = shenzhen; tstringlist * zqdm_list = new tstringlist (); ansistring py = ed_zqdm-> text.trim (); Ansistring Zqdm; getzqpy (market, py, zqdm_list); if (zqdm_list-> count == 0) {ShowMessage ("No Such ZqPy!"); return;} else if (zqdm_list-> count == 1) zqdm = zqdm_list- > Strings [0]; else {tf_selezqdmbypy * form; // Using constructor incoming information form = new TF_SELEZQPYBYPY (Application, Market, ZQDM_LIST); int RET = form-> showModal (); // Use public member to send information IF (RET == mryes) {zqdm = form-> zqdm; delete form;} else {delete form; return;}} ... ... f_selezqdmbypy header files are as follows: private: // Used to accept variables of incoming information INT Market; TStringList * zqdm_list; public: // to pass the variable of information ANSISTRING ZQDM; // Heavy Duty Construction Function__fastcall tf_selezqdmbypy (Tcomponent * Owner, int p_market, TstringList * p_zqdm_List); f_SeleZqdmByPy source file as follows: __fastcall f_SeleZqdmByPy :: Tf_SeleZqdmByPy (TComponent * Owner, int p_market, TStringList * p_zqdm_List): TForm (Owner) {// accept incoming information market = p_market; zqdm_list = new TstringList (); zqdm_list-> assign (p_zqdm_list);} In F_SELEZQDMBYPY, use ListView and other controls display ZQDM_LIST, the user selects the ZQDM member of the form (to pass the results), and set the MODALRESULT for the MRYES closing form, 6 Legal examination:. In principle, it is not in the EXIT event of the control, and the legality check code is written in the incident such as KeyDown. All legitimacy checks must be done again after pressing the confirmation, the store and other buttons. Avoid illegal input data caused by the user's movement focus. Press the confirmation, the legality check after the button and other button should be performed according to the order, if illegally, give a clear prompt information, and the focus should be moved to the corresponding input control.

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

New Post(0)