TTransferBuffer Checkbox Problem
-
Hallo,
Ich hab das Problem, dass der Zustand nicht übertragen wird, wenn ich die checkbox anklicke, darüber hinaus soll der wert in einer ini gesichert werden, was bei den anderen optionen klappt, aber hier nicht. Checkbox ist hier useadaptive
#if !defined(OWL_EDIT_H) #include <owl/edit.h> #endif #if !defined(OWL_UPDOWN_H) #include <owl/updown.h> #endif #if !defined(OWL_CHECKBOX_H) #include <owl/checkbox.h> #endif struct TTransferBuffer{ char masksizeWidth[5]; char masksizeHeight[5]; char meanthresh[5]; WORD useadaptive; }; class TSetupDialog : public TDialog { private: TEdit *maskWidth, *maskHeight, *thresh; TUpDown *udmask, *udmask2, *udthresh; TCheckBox *useadaptive; public: TSetupDialog(TWindow* parent, int resID, TTransferBuffer& ts); virtual void SetupWindow(); }; TSetupDialog::TSetupDialog(TWindow* parent, int resID, TTransferBuffer& ts) :TDialog(parent, resID) { maskWidth = new TEdit(this, IDC_MASKSIZE, 5); maskHeight = new TEdit(this, IDC_MASKSIZE_H, 5); thresh = new TEdit(this, IDC_MEANTRESH, 5); udmask = new TUpDown(this, IDC_UD_MASKSIZE); udmask2 = new TUpDown(this, IDC_UD_MASKSIZE_H); udthresh = new TUpDown(this, IDC_UD_MEANTRESH); useadaptive = new TCheckBox(this, IDC_ADAPTIVE_MEAN); SetTransferBuffer(&ts); } and the cpp: void TPictureWindow::CmChangeSettings() { TTransferBuffer tbuffer; char buffer[50]; unsigned long retval; sprintf(&tbuffer.masksizeWidth[0], "%5d", octcfg.maskWidth); sprintf(&tbuffer.masksizeHeight[0], "%5d", octcfg.maskHeight); sprintf(&tbuffer.meanthresh[0], "%5d", (int)(octcfg.edgeVal*10.1)); tbuffer.useadaptive = octcfg.useadaptive; if(TSetupDialog(this, IDD_SETUPDLG, tbuffer).Execute() == IDOK){ octcfg.maskWidth = atoi(&tbuffer.masksizeWidth[0]); octcfg.maskHeight = atoi(&tbuffer.masksizeHeight[0]); octcfg.edgeVal = atof(&tbuffer.meanthresh[0])/10.0; octcfg.useadaptive = tbuffer.useadaptive; HANDLE hDataFile = CreateFile("OCTopus.ini", GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); WriteFile(hDataFile, &octcfg, sizeof(octcfg), &retval, NULL); CloseHandle(hDataFile); }
-
Die OWL wurde 1999 von Borland aufgegeben und war (spätestens seitdem) nie offizieller Bestandteil des C++Builder. Dieses Forum ist der VCL gewidmet, es könnte schwierig werden, hier OWL-Fragen beantwortet zu kommen.