Time taking to load if there are more controls in the panel

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
nandakishore
Experienced Solver
Experienced Solver
Posts: 57
Joined: Wed Feb 25, 2015 2:09 pm
Location: Chennai, India

Time taking to load if there are more controls in the panel

Post by nandakishore » Mon May 15, 2017 10:14 am

Hi ,

I have an issue with the panel loading and it is taking more time (2-3 seconds) if it has more controls like 10 combo boxes , 10 check boxes , 10 buttons and 2-3 customized buttons(just combination of two controls) .
User is able to see the lag.

Is there a way to solve this problem.?

Thanks,
Nandakishore.
Got a Problem???..No worry..Focus on Solution not on Problem :P

coderrc
Earned some good credits
Earned some good credits
Posts: 141
Joined: Tue Nov 01, 2016 2:46 pm

Re: Time taking to load if there are more controls in the panel

Post by coderrc » Mon May 15, 2017 2:35 pm

does this problem exist in Release builds as well as debug builds?

I have this problem rather frequently in debug builds, but it goes away in release builds.

nandakishore
Experienced Solver
Experienced Solver
Posts: 57
Joined: Wed Feb 25, 2015 2:09 pm
Location: Chennai, India

Re: Time taking to load if there are more controls in the panel

Post by nandakishore » Mon May 15, 2017 4:13 pm

Yes it is exists in release mode too
Got a Problem???..No worry..Focus on Solution not on Problem :P

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2057
Joined: Sun Jan 03, 2010 5:45 pm

Re: Time taking to load if there are more controls in the panel

Post by PB » Mon May 15, 2017 5:01 pm

As you did not post or even hinted the code you are using to create the panel.

From my experience, a adding a LOT of items to a combobox can take quite some time on MSW. Other than that, do you load some images etc for your custom buttons?

Firstly, I would recommend commenting out the individual controls one by one to see which one(s) are responsible.

nandakishore
Experienced Solver
Experienced Solver
Posts: 57
Joined: Wed Feb 25, 2015 2:09 pm
Location: Chennai, India

Re: Time taking to load if there are more controls in the panel

Post by nandakishore » Mon May 15, 2017 5:43 pm

Yes i'm loading three images which is part of the customized control but the images are not even 10kb size.
Got a Problem???..No worry..Focus on Solution not on Problem :P

User avatar
doublemax
Moderator
Moderator
Posts: 14086
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Time taking to load if there are more controls in the panel

Post by doublemax » Mon May 15, 2017 5:44 pm

How many items are in the comboboxes and how do you add them?
Use the source, Luke!

nandakishore
Experienced Solver
Experienced Solver
Posts: 57
Joined: Wed Feb 25, 2015 2:09 pm
Location: Chennai, India

Re: Time taking to load if there are more controls in the panel

Post by nandakishore » Fri May 19, 2017 11:29 am

There are actually more than 20 controls in my panel. I have attached the image of my panel for your reference. Please find below the code I have used to add the controls to my panel.

Code: Select all

{
	pwxszrMainSizer = new wxBoxSizer(wxHORIZONTAL);

	//first column
	wxBoxSizer *pwxbxszFirstColumn = new wxBoxSizer(wxVERTICAL);
#if OLD_SELECTION
	m_pwxbtn2DSelection = new wxButton(this, AUTOQUALITY_SELECTION, _U("      Select 2D Elements        "));
	m_pwxbtnFeatureSelection = new wxButton(this, AUTOQUALITY_FEATURES, _U(" Select Features to Maintain "));
	pwxbxszFirstColumn->AddSpacer(10);
	pwxbxszFirstColumn->Add(m_pwxbtn2DSelection);
	pwxbxszFirstColumn->AddSpacer(10);
	pwxbxszFirstColumn->Add(m_pwxbtnFeatureSelection);
#else
	m_pSelnBtn2DSelection = (MWSelectButton*)CreateSelectionButton(this, AUTOQUALITY_SELECTION, MWSelection::Elements, TWOD_ELEMENT, "Select 2D Elements");
	m_pSelnBtn2DSelection->SetUIOption(INCLUDE_METHODS);
	m_pSelnBtnFeatureSelection = (MWSelectButton*)CreateSelectionButton(this, AUTOQUALITY_FEATURES, MWSelection::Components, -1, "Select 1D Features ");
	m_pSelnBtnFeatureSelection->SetUIOption(INCLUDE_METHODS);
	m_pSelnBtn2DFeatureSelection = (MWSelectButton*)CreateSelectionButton(this, AUTOQUALITY_2D_FEATURES, MWSelection::Components, -1, "Select 2D Features ");
	m_pSelnBtn2DFeatureSelection->SetUIOption(INCLUDE_METHODS);
	m_pSelnBtnFixedZoneSelection = (MWSelectButton*)CreateSelectionButton(this, AUTOQUALITY_2D_FIXEDZONE, MWSelection::Elements, TWOD_ELEMENT, "Select Fixed Zone");
	m_pSelnBtnFixedZoneSelection->SetUIOption(INCLUDE_METHODS);
	pwxbxszFirstColumn->AddSpacer(5);
	pwxbxszFirstColumn->Add(m_pSelnBtn2DSelection);
	pwxbxszFirstColumn->AddSpacer(5);
	pwxbxszFirstColumn->Add(m_pSelnBtn2DFeatureSelection);
	pwxbxszFirstColumn->AddSpacer(5);
	pwxbxszFirstColumn->Add(m_pSelnBtnFixedZoneSelection);
	pwxbxszFirstColumn->AddSpacer(5);
	pwxbxszFirstColumn->Add(m_pSelnBtnFeatureSelection);
#endif

	//second column
	wxBoxSizer *pwxbxszSecondColumn = new wxBoxSizer(wxVERTICAL);

	wxBoxSizer *pHorzColumn31 = new wxBoxSizer(wxHORIZONTAL);
	wxStaticText *stTxtAspectRatio = new wxStaticText(this, -1, _U("Boundary Elem. Aspect Ratio"), wxDefaultPosition, wxDefaultSize);
	m_pwxChckBox_AspectRatio = new wxCheckBox(this, AUTOQUALITY_CHBOX_ASPECTRATIO, "");
	m_ptxtAspectRatio = new wxTextCtrl(this, AUTOQUALITY_ASPECTRATION, _U("4.0"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	pHorzColumn31->Add(m_pwxChckBox_AspectRatio);
	pHorzColumn31->AddSpacer(5);
	pHorzColumn31->Add(stTxtAspectRatio);
	pHorzColumn31->AddSpacer(5);
	pHorzColumn31->Add(m_ptxtAspectRatio);
	m_pwxChckBox_AspectRatio->SetValue(true);

	wxSize StatictxtSize = stTxtAspectRatio->GetSize();

	wxBoxSizer *pHorzColumn1 = new wxBoxSizer(wxHORIZONTAL);
	wxStaticText *stTxtLength = new wxStaticText(this, -1, _U("Min. Edge Length   "), wxDefaultPosition,StatictxtSize);
	m_pwxChckBox_MinEdgeLen = new wxCheckBox(this, AUTOQUALITY_MINEDGELENGTH_CHKBOX, "", wxDefaultPosition, wxDefaultSize);
	m_ptxtMinEdgeLength = new wxTextCtrl(this, AUTOQUALITY_MINEDGELENGTH, _U("0.7"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	pHorzColumn1->Add(m_pwxChckBox_MinEdgeLen);
	pHorzColumn1->AddSpacer(5);
	pHorzColumn1->Add(stTxtLength);
	pHorzColumn1->AddSpacer(5);
	pHorzColumn1->Add(m_ptxtMinEdgeLength);
	m_pwxChckBox_MinEdgeLen->SetValue(true);

	
	wxBoxSizer *pHorzColumn2 = new wxBoxSizer(wxHORIZONTAL);
	wxStaticText *stTxtMinTriaAngle = new wxStaticText(this, -1, _U("Min. Tria Angle    "),wxDefaultPosition, StatictxtSize);
	m_pwxChckBox_MinTriangle = new wxCheckBox(this, AUTOQUALITY_MINTRIANGLE_CHKBOX, "");
	m_ptxtMinTriaAngle = new wxTextCtrl(this, AUTOQUALITY_MINTRIAANGLE, _U("20.0"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	pHorzColumn2->Add(m_pwxChckBox_MinTriangle);
	pHorzColumn2->AddSpacer(5);
	pHorzColumn2->Add(stTxtMinTriaAngle);
	pHorzColumn2->AddSpacer(5);
	pHorzColumn2->Add(m_ptxtMinTriaAngle);
	m_pwxChckBox_MinTriangle->SetValue(true);

	wxBoxSizer *pHorzColumn3 = new wxBoxSizer(wxHORIZONTAL);
	wxStaticText *stTxtMaxTriaAngle = new wxStaticText(this, -1, _U("Max. Tria Angle   "), wxDefaultPosition, StatictxtSize);
	m_pwxChckBox_MaxTriangle = new wxCheckBox(this, AUTOQUALITY_MAXTRIANGLE_CHKBOX, "");
	m_ptxtMaxTriaAngle = new wxTextCtrl(this, AUTOQUALITY_MAXTRIAANGLE, _U("120.0"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	pHorzColumn3->Add(m_pwxChckBox_MaxTriangle);
	pHorzColumn3->AddSpacer(5);
	pHorzColumn3->Add(stTxtMaxTriaAngle);
	pHorzColumn3->AddSpacer(5);
	pHorzColumn3->Add(m_ptxtMaxTriaAngle);
	m_pwxChckBox_MaxTriangle->SetValue(true);

	wxBoxSizer *pHorzColumnMinQuad = new wxBoxSizer(wxHORIZONTAL);
	wxStaticText *stTxtMinQuadAngle = new wxStaticText(this, -1, _U("Min. Quad Angle   "), wxDefaultPosition, StatictxtSize);
	m_pwxChckBox_MinQuadAngle = new wxCheckBox(this, AUTOQUALITY_MINQUADANGLE_CHKBOX, "");
	m_ptxtMinQuadAngle = new wxTextCtrl(this, AUTOQUALITY_MINQUADANGLE, _U("20.0"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	pHorzColumnMinQuad->Add(m_pwxChckBox_MinQuadAngle);
	pHorzColumnMinQuad->AddSpacer(5);
	pHorzColumnMinQuad->Add(stTxtMinQuadAngle);
	pHorzColumnMinQuad->AddSpacer(5);
	pHorzColumnMinQuad->Add(m_ptxtMinQuadAngle);
	m_pwxChckBox_MinQuadAngle->SetValue(true);


	wxBoxSizer *pHorzColumnMaxQuad = new wxBoxSizer(wxHORIZONTAL);
	wxStaticText *stTxtMaxQuadAngle = new wxStaticText(this, -1, _U("Max. Quad Angle  "), wxDefaultPosition, StatictxtSize);
	m_pwxChckBox_MaxQuadangle = new wxCheckBox(this, AUTOQUALITY_MAXQUADANGLE_CHKBOX, "");
	m_ptxtMaxQuadAngle = new wxTextCtrl(this, AUTOQUALITY_MAXQUADANGLE, _U("120.0"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	pHorzColumnMaxQuad->Add(m_pwxChckBox_MaxQuadangle);
	pHorzColumnMaxQuad->AddSpacer(5);
	pHorzColumnMaxQuad->Add(stTxtMaxQuadAngle);
	pHorzColumnMaxQuad->AddSpacer(5);
	pHorzColumnMaxQuad->Add(m_ptxtMaxQuadAngle);
	m_pwxChckBox_MaxQuadangle->SetValue(true);


	pwxbxszSecondColumn->AddSpacer(5);
	pwxbxszSecondColumn->Add(pHorzColumn1);
	pwxbxszSecondColumn->AddSpacer(2);
	pwxbxszSecondColumn->Add(pHorzColumn2);
	pwxbxszSecondColumn->AddSpacer(2);
	pwxbxszSecondColumn->Add(pHorzColumn3);
	pwxbxszSecondColumn->AddSpacer(2);
	pwxbxszSecondColumn->Add(pHorzColumnMinQuad);
	pwxbxszSecondColumn->AddSpacer(2);
	pwxbxszSecondColumn->Add(pHorzColumnMaxQuad);
	pwxbxszSecondColumn->AddSpacer(2);
	pwxbxszSecondColumn->Add(pHorzColumn31);
	
	wxBoxSizer *pwxbxszThirdColumnNew = new wxBoxSizer(wxVERTICAL);


	m_stTxtPerimeter = new wxStaticText(this, -1, _U("Perimeter Deviation  "), wxDefaultPosition);
	StatictxtSize = m_stTxtPerimeter->GetSize();

	wxBoxSizer *pHorzColumn = new wxBoxSizer(wxHORIZONTAL);
	wxStaticText *stTxttargetLength = new wxStaticText(this, -1, _U("Target Length (TL)    "), wxDefaultPosition, StatictxtSize);
	m_ptxtTargetLength = new wxTextCtrl(this, AUTOQUALITY_TARGETLENGTH, _U("5.0"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	pHorzColumn->Add(stTxttargetLength);
	pHorzColumn->AddSpacer(2);
	pHorzColumn->Add(m_ptxtTargetLength);

	wxBoxSizer *pHorzColumn12 = new wxBoxSizer(wxHORIZONTAL);
	m_stTxtSurface = new wxStaticText(this, -1, _U("Surface Deviation"), wxDefaultPosition, StatictxtSize);
	m_ptxtRFSurface = new wxTextCtrl(this, AUTOQUALITY_FROMSURFACE, _U("0.2"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	m_stTxtfactor2 = new wxStaticText(this, -1, _U(" * TL"));
	pHorzColumn12->Add(m_stTxtSurface);
	pHorzColumn12->AddSpacer(2);
	pHorzColumn12->Add(m_ptxtRFSurface);
	pHorzColumn12->AddSpacer(3);
	pHorzColumn12->Add(m_stTxtfactor2);

	wxBoxSizer *pHorzColumn22 = new wxBoxSizer(wxHORIZONTAL);
	m_ptxtRFPerimeters = new wxTextCtrl(this, AUTOQUALITY_FROMPERIMETER, _U("0.1"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	m_stTxtfactor1 = new wxStaticText(this, -1, _U(" * TL"));
	pHorzColumn22->Add(m_stTxtPerimeter);
	pHorzColumn22->AddSpacer(2);
	pHorzColumn22->Add(m_ptxtRFPerimeters);
	pHorzColumn22->AddSpacer(3);
	pHorzColumn22->Add(m_stTxtfactor1);


	wxBoxSizer *pHorzColumn4 = new wxBoxSizer(wxHORIZONTAL);
	wxStaticText *stTxtFeatureAngle = new wxStaticText(this, -1, _U("Feature Angle (FA)"), wxDefaultPosition, StatictxtSize);
	m_ptxtFeatureAngle = new wxTextCtrl(this, AUTOQUALITY_FEATUREANGLE, _U("20.0"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	pHorzColumn4->Add(stTxtFeatureAngle);
	pHorzColumn4->AddSpacer(2);
	pHorzColumn4->Add(m_ptxtFeatureAngle);

	wxBoxSizer *pHorzColumn5 = new wxBoxSizer(wxHORIZONTAL);
	wxStaticText *stTxtCornerAngle = new wxStaticText(this, -1, _U("Corner Angle (CA) "), wxDefaultPosition, StatictxtSize);
	m_ptxtCornerAngle = new wxTextCtrl(this, AUTOQUALITY_CORNERANGLE, _U("40.0"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	pHorzColumn5->Add(stTxtCornerAngle);
	pHorzColumn5->AddSpacer(2);
	pHorzColumn5->Add(m_ptxtCornerAngle);

	wxBoxSizer *pHorzColumn6 = new wxBoxSizer(wxHORIZONTAL);
	wxStaticText *stTxtGradation = new wxStaticText(this, -1, _U("Max. Gradation   "), wxDefaultPosition, StatictxtSize);
	m_ptxtMaxGradation = new wxTextCtrl(this, AUTOQUALITY_MAXGRADATION, _U("0.5"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	pHorzColumn6->Add(stTxtGradation);
	pHorzColumn6->AddSpacer(2);
	pHorzColumn6->Add(m_ptxtMaxGradation);

	pwxbxszThirdColumnNew->AddSpacer(5);
	pwxbxszThirdColumnNew->Add(pHorzColumn);
	pwxbxszThirdColumnNew->AddSpacer(2);
	pwxbxszThirdColumnNew->Add(pHorzColumn12);
	pwxbxszThirdColumnNew->AddSpacer(2);
	pwxbxszThirdColumnNew->Add(pHorzColumn22);
	pwxbxszThirdColumnNew->AddSpacer(2);
	pwxbxszThirdColumnNew->Add(pHorzColumn4);
	pwxbxszThirdColumnNew->AddSpacer(2);
	pwxbxszThirdColumnNew->Add(pHorzColumn5);
	pwxbxszThirdColumnNew->AddSpacer(2);
	pwxbxszThirdColumnNew->Add(pHorzColumn6);
	pwxbxszThirdColumnNew->AddSpacer(2);

#if	RELAXATION_COLUMN
	//third column
	wxBoxSizer *pwxbxszThirdColum = new wxBoxSizer(wxVERTICAL);

	m_pwxChkBox_RelaxFactors = new wxCheckBox(this, AUTOQUALITY_RELAXFACTORS, "Relaxation Factors");
	m_pwxChkBox_RelaxFactors->SetForegroundColour(*wxBLUE);

	wxBoxSizer *pHorzColumn21 = new wxBoxSizer(wxHORIZONTAL);
	m_stTxtPerimeter = new wxStaticText(this, -1, _U("From Perimeter       "));
	m_ptxtRFPerimeters = new wxTextCtrl(this, AUTOQUALITY_FROMPERIMETER, _U("0.2"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	m_stTxtfactor1 = new wxStaticText(this, -1, _U(" * TL"));
	pHorzColumn21->Add(m_stTxtPerimeter);
	pHorzColumn21->AddSpacer(10);
	pHorzColumn21->Add(5, 0);
	pHorzColumn21->Add(m_ptxtRFPerimeters);
	pHorzColumn21->AddSpacer(3);
	pHorzColumn21->Add(m_stTxtfactor1);

	wxBoxSizer *pHorzColumn22 = new wxBoxSizer(wxHORIZONTAL);
	m_stTxtSurface = new wxStaticText(this, -1, _U("From Surface          "));
	m_ptxtRFSurface = new wxTextCtrl(this, AUTOQUALITY_FROMSURFACE, _U("0.1"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	m_stTxtfactor2 = new wxStaticText(this, -1, _U(" * TL"));
	pHorzColumn22->Add(m_stTxtSurface);
	pHorzColumn22->AddSpacer(10);
	pHorzColumn22->Add(5,0);
	pHorzColumn22->Add(m_ptxtRFSurface);
	pHorzColumn22->AddSpacer(3);
	pHorzColumn22->Add(m_stTxtfactor2);

	wxBoxSizer *pHorzColumn23 = new wxBoxSizer(wxHORIZONTAL);
	m_stTxtFromFeatureAng = new wxStaticText(this, -1, _U("From Feature Angle"));
	m_ptxtRFFeatureAngle = new wxTextCtrl(this, AUTOQUALITY_FROMFEATUREANGLE, _U("2.0"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	m_stTxtfactor3 = new wxStaticText(this, -1, _U(" * FA"));
	pHorzColumn23->Add(m_stTxtFromFeatureAng);
	pHorzColumn23->AddSpacer(10);
	pHorzColumn23->Add(m_ptxtRFFeatureAngle);
	pHorzColumn23->AddSpacer(3);
	pHorzColumn23->Add(m_stTxtfactor3);

	wxBoxSizer *pHorzColumn24 = new wxBoxSizer(wxHORIZONTAL);
	m_stTxtFromCornerAng = new wxStaticText(this, -1, _U("From Corner Angle  "));
	m_ptxtRFCornerAngle = new wxTextCtrl(this, AUTOQUALITY_FROMCORNERANGLE, _U("2.0"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	m_stTxtfactor4 = new wxStaticText(this, -1, _U(" * CA"));
	pHorzColumn24->Add(m_stTxtFromCornerAng);
	pHorzColumn24->AddSpacer(9);
	pHorzColumn24->Add(m_ptxtRFCornerAngle);
	pHorzColumn24->AddSpacer(3);
	pHorzColumn24->Add(m_stTxtfactor4);

	pwxbxszThirdColum->AddSpacer(10);
	pwxbxszThirdColum->Add(m_pwxChkBox_RelaxFactors);
	pwxbxszThirdColum->AddSpacer(10);
	pwxbxszThirdColum->Add(pHorzColumn21);
	pwxbxszThirdColum->AddSpacer(5);
	pwxbxszThirdColum->Add(pHorzColumn22);
	pwxbxszThirdColum->AddSpacer(5);
	pwxbxszThirdColum->Add(pHorzColumn23);
	pwxbxszThirdColum->AddSpacer(5);
	pwxbxszThirdColum->Add(pHorzColumn24);
	pwxbxszThirdColum->AddSpacer(5);
#endif

	wxBoxSizer *pwxbxszFourthColummNew = new wxBoxSizer(wxVERTICAL);
	wxStaticText *statictxt_CorrectionMethods = new wxStaticText(this, -1, _U("Methods"));

	wxArrayString strlist;
	strlist.Add(_U("Swapping"));
	strlist.Add(_U("Collapse"));
	strlist.Add(_U("Expand"));
	strlist.Add(_U("Reduce Trias"));
	strlist.Add(_U("Collapse Sliver Face Elements"));
	strlist.Add(_U("Auto"));
	unsigned int count = strlist.GetCount();

	m_pListBtn_CorrectionMethods = new MWListButton(this, m_pMainFn, ID_LISTBTN_CORRECTIONMETHODS, strlist, count, 4, wxDefaultPosition, wxSize(180, -1), 0, 0);
	m_pListBtn_CorrectionMethods->SetSelectedItem(0);
	m_pListBtn_CorrectionMethods->OnChangeEvent(this, (VoidMemberFunction)&MW2DAutoQualityCorrectPanel::OnChangeQualityCorrectionMethods);

	m_pwxChkBox_Override = new wxCheckBox(this, AUTOQUALITY_OVERRIDE_FEATUREANGLE, "Override Feature Angle");
	wxArrayString strlist2;
	strlist2.Add(_U("Move To Mid"));
	strlist2.Add(_U("Collapse To Tangential"));
	strlist2.Add(_U("Snap To Feature"));

	unsigned int count1 = strlist2.GetCount();

	m_pListBtn_OverrideOpts = new MWListButton(this, m_pMainFn, ID_LISTBTN_OVERRIDEOPTS, strlist2, count1, 4, wxDefaultPosition, wxSize(180, -1), 0, 0);
	m_pListBtn_OverrideOpts->SetSelectedItem(0);

	pwxbxszFourthColummNew->AddSpacer(10);
	pwxbxszFourthColummNew->Add(statictxt_CorrectionMethods);
	pwxbxszFourthColummNew->AddSpacer(3);
	pwxbxszFourthColummNew->Add(m_pListBtn_CorrectionMethods);
	pwxbxszFourthColummNew->AddSpacer(10);
	pwxbxszFourthColummNew->Add(m_pwxChkBox_Override);
	pwxbxszFourthColummNew->AddSpacer(3);
	pwxbxszFourthColummNew->Add(m_pListBtn_OverrideOpts);

	wxBoxSizer *pwxbxszFourthColumm = new wxBoxSizer(wxVERTICAL);

	m_pwxChkBox_QualityFlow = new wxCheckBox(this, AUTOQUALITY_QUALITYFLOW, "Adjust Mesh Flow");
	m_pwxChkBox_RemeshNonFeatureElems = new wxCheckBox(this, AUTOQUALITY_REMESH_NONFEATURE_ELEMS, "Remesh Non Feature Elements");
	
	m_stTxtRemeshType = new wxStaticText(this, -1, _U("Remesh Type"), wxDefaultPosition, wxDefaultSize);
	wxArrayString strlist1;
	strlist1.Add(_U("Tria"));
	strlist1.Add(_U("Quad"));
	strlist1.Add(_U("Mixed"));
	strlist1.Add(_U("RTria"));
	count = strlist1.GetCount();
	m_pListBtn_RemeshType = new MWListButton(this, m_pMainFn, ID_LISTBTN_REMESHTYPE, strlist1, count, 4, wxDefaultPosition, wxSize(100, -1), 0, 0);
	m_pListBtn_RemeshType->SetSelectedItem(0);
	
	m_pwxChkBox_SmoothOpt= new wxCheckBox(this, AUTOQUALITY_SMOOTH, "Treatment After Saturation");
	m_pwxChkBox_SmoothOpt->SetForegroundColour(*wxBLUE);

	wxBoxSizer *pwxbxszFourtColummHz1 = new wxBoxSizer(wxHORIZONTAL);
	m_stTxtSmoothIter = new wxStaticText(this, -1, _U("Smooth Iterations"));
	m_ptxtSmoothIter = new wxTextCtrl(this, AUTOQUALITY_FEATUREANGLE, _U("10"), wxDefaultPosition, wxSize(40, 20), 0, wxTextValidator(wxFILTER_NUMERIC, NULL));
	pwxbxszFourtColummHz1->Add(m_stTxtSmoothIter);
	pwxbxszFourtColummHz1->AddSpacer(15);
	pwxbxszFourtColummHz1->Add(m_ptxtSmoothIter);

	pwxbxszFourthColumm->AddSpacer(10);
	pwxbxszFourthColumm->Add(m_pwxChkBox_QualityFlow);
	pwxbxszFourthColumm->AddSpacer(7);
	pwxbxszFourthColumm->Add(m_pwxChkBox_RemeshNonFeatureElems);
	pwxbxszFourthColumm->AddSpacer(7);
	pwxbxszFourthColumm->Add(m_stTxtRemeshType);
	pwxbxszFourthColumm->AddSpacer(2);
	pwxbxszFourthColumm->Add(m_pListBtn_RemeshType);
	pwxbxszFourthColumm->AddSpacer(7);
	pwxbxszFourthColumm->Add(m_pwxChkBox_SmoothOpt);
	pwxbxszFourthColumm->AddSpacer(7);
	pwxbxszFourthColumm->Add(pwxbxszFourtColummHz1);

	wxBoxSizer *pwxszrpPreviewColmn = new wxBoxSizer(wxVERTICAL);
	m_p3dbtnPreview = new MW3DButton(m_pMainFn->GetReviewBnColour(), this, AUTOQUALITY_PREVIEW, _("Preview"), wxDefaultPosition, wxSize(100, 25));
	m_pwxChckBox_AutoSaturation = new wxCheckBox(this, AUTOQUALITY_AUTO_TILL_SATURATION, _U("Auto Saturation"));

	pwxszrpPreviewColmn->AddSpacer(10);
	pwxszrpPreviewColmn->Add(m_p3dbtnPreview);
	pwxszrpPreviewColmn->AddSpacer(5);
	pwxszrpPreviewColmn->Add(m_pwxChckBox_AutoSaturation);

	//final column
	wxBoxSizer *pwxszrEndColmn = new wxBoxSizer(wxVERTICAL);
	m_p3dbtnAccept = new MW3DButton(2, this, AUTOQUALITY_EXECUTE, _("Execute"), wxDefaultPosition, wxSize(100, 25));
	m_p3dbtnReset = new MW3DButton(m_pMainFn->GetResetBnColour(), this, AUTOQUALITY_RESET, _("Reset"), wxDefaultPosition, wxSize(100, 25));
	m_p3dbtnReturn = new MW3DButton(m_pMainFn->GetReturnBnColour(), this, AUTOQUALITY_RETURN, _("Return"), wxDefaultPosition, wxSize(100, 25));
	pwxszrEndColmn->AddSpacer(10);
	pwxszrEndColmn->Add(m_p3dbtnAccept);
	pwxszrEndColmn->AddSpacer(10);
	pwxszrEndColmn->Add(m_p3dbtnReset);
	pwxszrEndColmn->AddSpacer(10);
	pwxszrEndColmn->Add(m_p3dbtnReturn); 

	pwxszrMainSizer->AddSpacer(10);
	pwxszrMainSizer->Add(pwxbxszFirstColumn);
	pwxszrMainSizer->AddSpacer(15);
	pwxszrMainSizer->Add(pwxbxszSecondColumn);
	pwxszrMainSizer->AddSpacer(20);
	pwxszrMainSizer->Add(pwxbxszThirdColumnNew);
	pwxszrMainSizer->AddSpacer(25);

#if	RELAXATION_COLUMN
	pwxszrMainSizer->Add(pwxbxszThirdColum);
	pwxszrMainSizer->AddSpacer(40);
#endif
	pwxszrMainSizer->Add(pwxbxszFourthColummNew);
	pwxszrMainSizer->AddSpacer(15);
	pwxszrMainSizer->Add(pwxbxszFourthColumm);
	pwxszrMainSizer->AddSpacer(40);
	pwxszrMainSizer->Add(pwxszrpPreviewColmn);
	pwxszrMainSizer->AddSpacer(25);
	pwxszrMainSizer->Add(pwxszrEndColmn);

	wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
#if OLD_SELECTION
	wxSizer *statsizer = CreateStatusBar(_U("Quality Correction"));
#else
	wxWindow *statsizer = CreateStatusBar(_U("Quality Correction"));
#endif
	sizer->Add(statsizer);
	sizer->Add(pwxszrMainSizer);

	SetAutoLayout(TRUE);
	SetSizer(sizer);
	sizer->SetSizeHints(this);
	sizer->Fit(this);
}
Attachments
quality panel.png
quality panel.png (21.14 KiB) Viewed 958 times
Got a Problem???..No worry..Focus on Solution not on Problem :P

User avatar
doublemax
Moderator
Moderator
Posts: 14086
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Time taking to load if there are more controls in the panel

Post by doublemax » Fri May 19, 2017 1:36 pm

Unless your program is running on a very slow machine, i don't see anything that could take 2-3 seconds.

Could the delay be caused by other code parts?
Use the source, Luke!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3466
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Time taking to load if there are more controls in the panel

Post by ONEEYEMAN » Fri May 19, 2017 2:18 pm

Hi,
Try running a profiler, either one from MSVC or the one with MinGW.

Without actually profiling the code run it will be shot in the dark.

Thank you.

Post Reply