The status of the group and records of the BCB and changes to the status of the control

zhaozj2021-02-16  60

If you can use the number of groups to bring us a lot of convenience; the following is some of my usage, I still feel that I have the essence of it; I hope everyone will guide; (now ugly)

Void) __DECLSPEC (DLLEXPORT) MYList :: Readlist (ANSISTRING TS) {// reads the data of the INI file System :: ANSISTRING LABPATH = extractFilePath (".//"); tinifile * Labini = New TiniFile (LabPath "labini.ini ");

FORM2-> addlist (); for (int i = 0; i labellist-> count; i ) {tlabel * lab; lab = (tlabel *) Form2-> labellist-> items [i]; lab- > Left = Labini-> Readinteger (TS, "Left" INTOSTR (I), LAB-> Left); lab-> top = Labini-> Readinteger (TS, "TOP" INTOSTR (i), lab-> top );}} File: // ------------------------------------------ ----------------------------------

Void MyList :: WriteList (ANSISTRING TS) {// Write file System :: ANSISTRING LABPATH = ExtractFilePath (".//"); tinifile * Labini = New TiniFile (LabPath "Labini.ini"); Form2-> AddList ( ); For (int i = 0; i labellist-> count; i ) {TLABEL * LAB; lab = (tlabel *) Form2-> labellist-> items [i]; labini-> WriteInteger (TS, "Left" INTOSTR (I), LAB-> Left; Labini-> Writeinteger (TS, "TOP" INTOSTR (I), LAB-> TOP);}}

File: // ---------------------------------------------- --------------------------------------------

System :: ANSISTRING LABPATH = extractfilepath (".//"); tinifile * labini = new tinifile (LabPath "Labini.ini");

TList * labellist; labellist-> add (labelliist-> add (label2); labellist-> add (labellist-> add (labellist-> add (labellist-> add (labelliist); labellist -> add (label6); labellist-> add (labellist-> add (labellist-> add (labellist-> add (labelliist-> add (labellst-> add (labelliist-> add (labelliist-> add (labell1); labellist-> Add (label12); labellist-> add (label13); labellist-> add (label14); labellist-> add (label15); file: // --------------- -------------------------------------------------- -----------------------------------

Void mylist :: nmychick (tMenuItem * Item, Ansistring Str, INT BL) {file: // Record the status of TMENUITEM: static tMenuItem * Sitem = 0; file: // item = form2-> popupmenu1-> items; file: / / Item = dynamic_cast (form2-> windowmenu-> items-> getParentMenu); if (sitem == item) {item-> checked = false; return;} else if (sitem) Sitem-> checked = false Ipiem-> checked = true; Sitem = item; if (item-> checked == true) {file: // ¯¯¬¬¬ä ä ÄFORM2μä' ¡ð¡¡ Oíðî × 'IF (BL) {FORM2-> Image1-> Picture-> Bitmap-> Height = 500; Form2-> Image1-> Picture-> Bitmap-> width = 732; Form2-> image1-> stretch = false;

File: // form2-> image2-> pictures (".//logo.bmp"); form2-> image2-> width = form2-> image2-> picture-> width; Form2-> image2-> Height = form2-> image2-> picture-> height; form2-> image2-> top = 12; form2-> image2-> left = 15; form2-> height = 500; Form2-> width = 732; Form2-> TOP = 0; FORM2-> LEFT = Screen-> width-form2-> width; tcanvas * tss = form2-> image1-> Picture-> Bitmap-> Canvas; Form1-> Drawbarcode (TSS, 120, 300, 125); FORM2-> Update ();} else {form2-> image1-> picture-> bitmap-> height = 732; form2-> image1-> picture-> bitmap-> width = 555; FORM2-> image1-> stretch = false; Form2 -> image2-> width = form2-> image2-> picture-> width; form2-> image2-> height = form2-> image2-> picture-> height; form2-> image2-> top = 12; Form2-> Image2-> left = 15; form2-> height = 732; FORM2-> width = 555; FORM2-> TOP = 0; FORM2-> Left = screen-> width-form2-> w Idth; form1-> makelabel ();} form2-> caption = string (form2-> image1-> picture-> bitmap-> height) "-" string (form2-> image1-> Picture-> Bitmap-> Width); file: // ------------------------------------------- -------------- Readlist (str); Form2-> Update ();

}

File: // ---------------------------------------------- -------------------------------------------------- --------

Void __fastcall tform2 :: formhide (TOBJECT * Sender) {ANSISTRING BJ [] = {"Hand 1", "Mouth 1", "Hand 2", "Placement 2", "Hand 3", "Playing 3" , "Restore this setting"}; for (int i = 0; i items-> count; i ) {if (popupmenu1-> items-> items [i] -> checked) lt-> writelist ( BJ [i]);

}

File: // ---------------------------------------------- -----------------------------

Void __fastcall tform2 :: n4click (TOBJECT * Sender) {lt-> nmychick (form2-> n4, "mouth 2", 0);} file: // -------------- -------------------------------------------------- -----------

Void __fastcall tform2 :: n5click (TOBJECT * Sender) {lt-> nmychick (form2-> n5, "horizontal 2", 1);} file: // --------------- -------------------------------------------------- ------------

Void __fastcall tform2 :: n31click (TOBJECT * Sender) {lt-> nmychick (Form2-> N31, "Mount 3", 0);} file: // -------------- -------------------------------------------------- -----------

Void __fastcall tform2 :: n32click (TOBJECT * Sender) {lt-> nmychick (form2-> n32, "horizontal 3", 1);} file: // ------------- -------------------------------------------------- ------------

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

New Post(0)