*** tpb has joined #freeorion | 00:00 | |
*** StrangerDanger has joined #freeorion | 01:15 | |
*** neuro8 has joined #freeorion | 02:04 | |
neuro8 | yeaaaah | 02:04 |
---|---|---|
GeofftheMedio | ? | 02:30 |
neuro8 | Just coding | 02:39 |
neuro8 | Working on my fleetwnd splitter | 02:42 |
GeofftheMedio | fun times | 02:48 |
neuro8 | OOP-wise, do you think it's better for the Splitter object to take references to the fleet list box and the fleet detail view and resize them from within, or just broadcast an event when the user drags it, and the FleetWnd is in charge of resizing | 02:52 |
GeofftheMedio | model it after GG::Layout | 02:56 |
GeofftheMedio | meaning: store pointers to contained Wnd objects and tell them to resize when the splitter is manipulated | 02:57 |
neuro8 | hmm | 02:57 |
GeofftheMedio | but: respect contents' MinUsableSize and prevent the splitter tab from moving beyond this range | 03:03 |
neuro8 | Right, I've got it displaying, the splitter tab itself... | 03:03 |
neuro8 | And it has a min + a max | 03:03 |
neuro8 | Was trying to declare these as references | 03:04 |
neuro8 | Wnd* m_top_wnd; | 03:04 |
neuro8 | Wnd* m_btm_wnd; | 03:04 |
neuro8 | 03:04 | |
GeofftheMedio | not sure what you mean by "trying to declare ... as references" | 03:05 |
neuro8 | Sorry | 03:05 |
neuro8 | The Splitter class is implementing/respecting MinUsableSize | 03:06 |
GeofftheMedio | you might want to make things a bit more generic though, to allow left-right splitters as well | 03:06 |
neuro8 | m_fleet_splitter = new GG::Splitter(GG::X0, GG::Y0, GG::X1, GG::Y(14), GG::VERTICAL, GG::CLR_GRAY, GG::CLR_WHITE, GG::INTERACTIVE, m_fleets_lb, m_fleet_detail_panel); | 03:06 |
neuro8 | The last two arguments I'm passing in are references to the two GG::Wnd objects I want to "split" | 03:07 |
GeofftheMedio | those don't need to be in the constructor... | 03:07 |
neuro8 | I think I implemented it so you could make it a horizontal splitter if you change it to GG::HORIZONTAL in the arguments | 03:07 |
GeofftheMedio | like Layout, you can have an Add function that takes a Wnd* and an index for whether it's the left/top or right/bottom Wnd | 03:08 |
neuro8 | Ah | 03:08 |
neuro8 | I made an assumption that a splitter would always split 2 wnds | 03:08 |
GeofftheMedio | it probably would, but that still doesn't mean you need to take two Wnd* in the constructor, or need to know which to Wnd will be split when constructing | 03:09 |
GeofftheMedio | THAT said, it should be possible to put a Splitter or Layout on one side of the splitter, and have all the contents react appropriately | 03:10 |
neuro8 | Hm | 03:11 |
GeofftheMedio | that shouldn't be much / any extra work, though, as both Splitter and Layout are derived from Wnd | 03:11 |
neuro8 | So if I add a Wnd and it's index, it'll resize based on its position in the parent view (0 -> 100% of it's total position) | 03:11 |
neuro8 | void Add(Wnd* wnd, std::size_t index); | 03:12 |
GeofftheMedio | probably keep the same size in pixels, not % position | 03:13 |
neuro8 | Ok | 03:17 |
neuro8 | Should I define custom WndPosition struct for the for positions? or just use like an int for an index | 03:18 |
GeofftheMedio | not sure what you mean | 03:18 |
neuro8 | This is in Layout.h to keep track of all the Wnd's | 03:20 |
neuro8 | std::map<Wnd*, WndPosition> m_wnd_positions; | 03:20 |
neuro8 | But WndPosition is a struct defined in it with a few properties to keep track of these wnds | 03:21 |
*** STalKer-X has quit IRC | 03:22 | |
neuro8 | I think I can just do this | 03:23 |
neuro8 | std::map<Wnd*, int> m_wnd_positions; | 03:23 |
neuro8 | Then in my Add method do this : | 03:23 |
neuro8 | m_wnd_positions[wnd] = index; | 03:23 |
GeofftheMedio | The left / top Wnd will always be at (0,0), won't it? And the right / bottom Wnd always positioned relative to the splitter | 03:23 |
GeofftheMedio | I don't really know what WndPosition is used for in Layout, though | 03:24 |
GeofftheMedio | oh.. it's mostly just to keep track of what cell of the Layout a Wnd is in | 03:25 |
GeofftheMedio | or cells | 03:25 |
GeofftheMedio | and its alignment, and original position and size | 03:26 |
neuro8 | Right | 03:27 |
GeofftheMedio | You could use Alignments like in Layout to decide whether and how to resize and reposition contained Wnds when resizing the Splitter or moving the splitter tab, but I think it's sufficient to just store Wnd* upper_left_wnd and Wnd* lower_right_wnd | 03:27 |
GeofftheMedio | dont' see need for a map for what is always two pointers... | 03:27 |
neuro8 | So actually have two Wnd* values? | 03:27 |
neuro8 | huh | 03:27 |
GeofftheMedio | seems reasonable | 03:27 |
neuro8 | Cool | 03:28 |
neuro8 | I was makin' that m_wnd_positions map work but that makes much more sense | 03:28 |
GeofftheMedio | You could have a WndPosition struct, but it would only need to contain the Wnd's Alignment, and original position and size. Then you'd just have WndPosition upper_left_wnd_position and WndPosition lower_right_wnd_position instead of a map like Layout has | 03:31 |
neuro8 | Ah... | 03:35 |
neuro8 | So a custom struct to contain alignment, position, size | 03:35 |
neuro8 | That seems more complex but probably more useful. | 03:36 |
neuro8 | Add an assert, and some checks that will throw errors if the Wnd's are already occupied. Compiling | 03:36 |
GeofftheMedio | you can make a struct or not... three bits of info is borderline on whether it's worth it. Layout uses a struct since it's got about 8 bits of info and is storing it all in a map... | 03:37 |
neuro8 | I'm just going to keep going with two Wnd* references | 03:39 |
GeofftheMedio | I meant for storing alignment and original position and size | 03:42 |
neuro8 | Wow build succeeded! | 03:43 |
GeofftheMedio | (current position and size don't need to be stored... they're available from the two Wnd*) | 03:43 |
neuro8 | Yeah actually it would be good to keep those... | 03:43 |
neuro8 | I should call it something else though, right? | 03:46 |
neuro8 | It's defined as " struct GG_API WndPosition" | 03:46 |
GeofftheMedio | the current one is a private struct within Layout... you can have a similarly-named struct within Splitter without problem | 03:48 |
GeofftheMedio | but sure, call it something else to be safe | 03:48 |
*** STalKer-X has joined #freeorion | 03:49 | |
neuro8 | Weird. Getting a "Timed out while attempting to connect to server" | 03:53 |
GeofftheMedio | restart program and try again... sometimes networking has hiccups | 03:56 |
CIA-19 | FreeOrion: geoffthemedio * r4005 /trunk/FreeOrion/msvc2010/ (8 files in 7 dirs): Updated MSVC 2010 project files to use Boost 1.46.1 and FreeType 2.4.4, and Python 2.7. | 03:56 |
neuro8 | Rad. That worked | 03:59 |
neuro8 | lol well my Splitter's THERE, it's just not doing anything. | 04:01 |
neuro8 | Also, it's at the bottom of the FleetWnd | 04:01 |
neuro8 | Aright man. Have a good night / day | 04:29 |
GeofftheMedio | night here | 04:31 |
neuro8 | Welp, yeah, have a good night. Made some good progress on this but I need to crash | 04:38 |
*** neuro8 has quit IRC | 05:01 | |
*** GeofftheMedio has quit IRC | 06:07 | |
*** GeofftheMedio has joined #freeorion | 06:31 | |
CIA-19 | FreeOrion: geoffthemedio * r4006 /trunk/FreeOrion/ (12 files in 3 dirs): (log message trimmed) | 09:52 |
CIA-19 | FreeOrion: -Switch sound / music settings from "disable" to "enable" when active. Made them not flags when doing this, as flags are default off unless present. | 09:52 |
CIA-19 | FreeOrion: -Updated all uses of UI sounds and default option settings to use absolute | 09:52 |
CIA-19 | FreeOrion: pathes instead of relative (to Sound directory) pathes. Sound directory is now | 09:52 |
CIA-19 | FreeOrion: mainly (just?) the default location where to search for such files when | 09:52 |
CIA-19 | FreeOrion: modifying the options. | 09:52 |
CIA-19 | FreeOrion: -Tweaked an exception catching debug output line. | 09:52 |
*** VargaD has joined #freeorion | 13:04 | |
*** VargaD has quit IRC | 15:14 | |
*** StrangerDanger has quit IRC | 18:10 | |
*** theTroy has joined #freeorion | 19:06 | |
*** theTroy has quit IRC | 21:14 | |
*** GeofftheMedio_ has joined #freeorion | 21:58 | |
*** GeofftheMedio has quit IRC | 22:00 | |
*** GeofftheMedio_ is now known as GeofftheMedio | 22:00 | |
*** GeofftheMedio_ has joined #freeorion | 22:13 | |
*** GeofftheMedio has quit IRC | 22:16 | |
*** GeofftheMedio_ is now known as GeofftheMedio | 22:16 | |
CIA-19 | FreeOrion: geoffthemedio * r4007 /trunk/FreeOrion/ (CMakeLists.txt UI/FleetWnd.cpp): | 23:21 |
CIA-19 | FreeOrion: -Modified creation of new fleets in fleetwnd by dropping onto new fleet panel so that old fleets that are empty are also ordered deleted. | 23:21 |
CIA-19 | FreeOrion: -Minor tweak to CMakeLists.txt to show required boost version in an error message, as suggested on forums. | 23:21 |
CIA-19 | FreeOrion: geoffthemedio * r4008 /trunk/FreeOrion/UI/ClientUI.cpp: Made FleetWnd closing when right-clicking on empty space default off. | 23:38 |
Generated by irclog2html.py 2.5 by Marius Gedminas - find it at mg.pov.lt!