Page 1 of 1


Posted: Tue Aug 13, 2019 9:20 pm
by bandali99
Hi, I am using boxsizers to create a timeline media player. I used a similar format from an older media player I had made early (thanks to doublemax).

I'm running into two formating issues the first being that I want to scale the media bars in relation to the longest bar. Currently, I have them completely expanded.

I have a link to the git if the code provided isnt enough:

but I have a feeling the issue has something to do with my sizers here and maybe I need to add proportions?

Code: Select all

	slider4sizer->Add(slider4check, 1, wxLEFT);
	slider4sizer->Add(TimeText4, 1, wxRIGHT);
	slider4sizer->Add(FrameText4, 1, wxRIGHT);

	playerSizer->Add(slide, 4, wxEXPAND);
	player2Sizer->Add(slide2, 3, wxEXPAND);

	player3Sizer->Add(slide3, 2, wxEXPAND);

	player4Sizer->Add(slide4, 1, wxEXPAND);

	mediaSizer->Add(playerSizer, 1, wxEXPAND);
	mediaSizer->Add(player2Sizer, 1, wxEXPAND);
	mediaSizer->Add(player3Sizer, 1, wxEXPAND);
	mediaSizer->Add(player4Sizer, 1, wxEXPAND);
The next issue is minor but if any has an idea that would be awesome- I want the media bars to align directly in the middle of each textbox in their row.

Re: BoxSizers

Posted: Tue Aug 13, 2019 10:07 pm
by doublemax

Code: Select all

playerSizer->Add(slider1sizer, 0, wxALIGN_CENTER_VERTICAL);
playerSizer->Add(slide, 1000, wxEXPAND);

player2Sizer->Add(slider2sizer, 0, wxALIGN_CENTER_VERTICAL);
player2Sizer->Add(slide2, 750, wxEXPAND);

player3Sizer->Add(slider3sizer, 0, wxALIGN_CENTER_VERTICAL);
player3Sizer->Add(slide3, 500, wxEXPAND);

player4Sizer->Add(slider4sizer, 0, wxALIGN_CENTER_VERTICAL);
player4Sizer->Add(slide4, 250, wxEXPAND);
The values like (1000-750) need to be calculated by the actual ranges of the sliders always based on the biggest one.