4-way-splitter
i''m using cbuilder5 and opengl.
i would like to create four views(perspective+ortho[1,2,3])
to show the model.
(something like that http://www.gamedev.net/reference/articles/article1358.asp )
the default splitter control is useless, bc. i can use 2 max. 3 viewports. (one horizontal and one vertical split)
anyone knows if there is a good freeware control to make this possible?
you can have as many as you want to.
I made a small http browser using 7 splitters and multiple OpenGL windows.
For your OpenGL windows, place them in a Tpanel, makes them easy to manage aswell.
PS - it is faster to use a stencil for OpenGL than multiple viewport windows.
Beer - the love catalyst
good ol'' homepage
I made a small http browser using 7 splitters and multiple OpenGL windows.
For your OpenGL windows, place them in a Tpanel, makes them easy to manage aswell.
PS - it is faster to use a stencil for OpenGL than multiple viewport windows.
Beer - the love catalyst
good ol'' homepage
1.
yes. but it don''t looks right.
2.
i allready use TPanel as rendering context.
3.
when i use stencil buffer it only gets more complicated to manage the "windows" (resizing,...). currently speed is not the problem.
yes. but it don''t looks right.
2.
i allready use TPanel as rendering context.
3.
when i use stencil buffer it only gets more complicated to manage the "windows" (resizing,...). currently speed is not the problem.
Um. Dunno if such a thing exists! Well, what I would do, is write a descendant from TPanel that setups a 4 TPanel children, overload the Paint() function, then draw the splitters. Also, capture clicks in the regions, and do that.
It shouldn''t be too difficult. What''s wrong with the default splitter? It looks ok to me =P
------------------------------
BCB DX Library - RAD C++ Game development for BCB
It shouldn''t be too difficult. What''s wrong with the default splitter? It looks ok to me =P
------------------------------
BCB DX Library - RAD C++ Game development for BCB
I see what you are getting at
you mean you want a panel which is changed like a big cross
In that case you only need three splits
split one vertically
Now split each horizontally.
Link both horizontal ones together so they are always at the same height.
Bingo, your splitter is done.
you mean you want a panel which is changed like a big cross
In that case you only need three splits
split one vertically
Now split each horizontally.
Link both horizontal ones together so they are always at the same height.
Bingo, your splitter is done.
>>Dredge-Master
YES, that is exactly what i want to have. thanks.
but i don''t know how to "LINK" the horizontal ones together.
i''ve tried to set the Top property in the OnMoved Event. but
it seems to be read only (also can''t set it in OnFormCreate).
i `ll explain what i would like to have:
1.as you allready said a "cross splitter". (LINK prob)
2.the positions of the splitter need sometimes to be set manual (code).
e.g. to save/load the positions from file (so the user don''t have to align the views every time).
that also would be usable to maximize one view forth/back.
any thoughts??
YES, that is exactly what i want to have. thanks.
but i don''t know how to "LINK" the horizontal ones together.
i''ve tried to set the Top property in the OnMoved Event. but
it seems to be read only (also can''t set it in OnFormCreate).
i `ll explain what i would like to have:
1.as you allready said a "cross splitter". (LINK prob)
2.the positions of the splitter need sometimes to be set manual (code).
e.g. to save/load the positions from file (so the user don''t have to align the views every time).
that also would be usable to maximize one view forth/back.
any thoughts??
I''ll post the code and stuff for it
give us a few minutes
Beer - the love catalyst
good ol'' homepage
give us a few minutes
Beer - the love catalyst
good ol'' homepage
You might aswell start a new project to see what I did first, that way you wont screw yours up. If not, atleast back up your project first.
Okay, firstly I started with the two panels and a vertical splitter
In each of these windows I placed two more panels and a horizontal splitter in each. I had the top two as panel3 (top left) and panel4 (top right). These are the panels that are aligned to top , the other two (bottom two) are the client panels. See the image (and squint as I shrunk it down). This is the completed form.
Now select the two top panels, and go to their events tab on the oject inspector. in the OnResize , ad a function, I called mine SplitterResize and press enter.
This is what your screen should look kind of like.
Last step is the code. Go back to your code (unit1.cpp if its a new form) and add in this code.
It checks to see which side moved, then it makes the other side the same height.
Hope that helped you.
Seeya,
James.
Beer - the love catalyst
good ol'' homepage
Okay, firstly I started with the two panels and a vertical splitter
In each of these windows I placed two more panels and a horizontal splitter in each. I had the top two as panel3 (top left) and panel4 (top right). These are the panels that are aligned to top , the other two (bottom two) are the client panels. See the image (and squint as I shrunk it down). This is the completed form.
Now select the two top panels, and go to their events tab on the oject inspector. in the OnResize , ad a function, I called mine SplitterResize and press enter.
This is what your screen should look kind of like.
Last step is the code. Go back to your code (unit1.cpp if its a new form) and add in this code.
It checks to see which side moved, then it makes the other side the same height.
if(Sender==Panel4) Panel3->Height=Panel4->Height;else Panel4->Height=Panel3->Height;
Hope that helped you.
Seeya,
James.
Beer - the love catalyst
good ol'' homepage
Oh and to set the splitter height at run time, just save the first panel (panel3) dimension.
When the form loads, set the first panel (panel3) to that height and width, then also set the other panel (panel4) to the same height, or call the function SplitterResize(panel4). Either will work fine (although setting the height is the best thing to do)
So lets say in your
FormLoad (or whatever it is called)
you have code like
in=fopen("mysavedstuff.dat");
ReadSetupData(in);
Panel3->Height=setupdata.height;
Panel4->Height=setupdata.height;
Panel3->Width=setupdata.width;
fclose(in);
(as a note, a better way is to condense the lines to)
in=fopen("mysavedstuff.dat");
ReadSetupData(in);
Panel3->Height=Panel4->Height=setupdata.height;
Panel3->Width=setupdata.width;
fclose(in);
Edited by - Dredge-Master on January 22, 2002 8:22:30 AM
When the form loads, set the first panel (panel3) to that height and width, then also set the other panel (panel4) to the same height, or call the function SplitterResize(panel4). Either will work fine (although setting the height is the best thing to do)
So lets say in your
FormLoad (or whatever it is called)
you have code like
in=fopen("mysavedstuff.dat");
ReadSetupData(in);
Panel3->Height=setupdata.height;
Panel4->Height=setupdata.height;
Panel3->Width=setupdata.width;
fclose(in);
(as a note, a better way is to condense the lines to)
in=fopen("mysavedstuff.dat");
ReadSetupData(in);
Panel3->Height=Panel4->Height=setupdata.height;
Panel3->Width=setupdata.width;
fclose(in);
Edited by - Dredge-Master on January 22, 2002 8:22:30 AM
wow, big thanks for the great reply!
it works 99% right.
i''ve done what you have suggested.
and all works, exept setting the panel width.
e.g.
Panel3->Width is 100;
in OnCreate i set Panel->Width=200;
but that has no effect, it stays the same as in the CBuilder IDE.
(so the manual setting of the vertical splitter don''t work!!)
i hope you have an answer on this.
i''m so close to getting it right, so there must be an answer :-)
it works 99% right.
i''ve done what you have suggested.
and all works, exept setting the panel width.
e.g.
Panel3->Width is 100;
in OnCreate i set Panel->Width=200;
but that has no effect, it stays the same as in the CBuilder IDE.
(so the manual setting of the vertical splitter don''t work!!)
i hope you have an answer on this.
i''m so close to getting it right, so there must be an answer :-)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement