Friday, 2011-06-24

*** tpb has joined #freeorion00:00
*** StrangerDanger has joined #freeorion01:15
*** neuro8 has joined #freeorion02:04
neuro8yeaaaah02:04
GeofftheMedio?02:30
neuro8Just coding02:39
neuro8Working on my fleetwnd splitter02:42
GeofftheMediofun times02:48
neuro8OOP-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 resizing02:52
GeofftheMediomodel it after GG::Layout02:56
GeofftheMediomeaning: store pointers to contained Wnd objects and tell them to resize when the splitter is manipulated02:57
neuro8hmm02:57
GeofftheMediobut: respect contents' MinUsableSize and prevent the splitter tab from moving beyond this range03:03
neuro8Right, I've got it displaying, the splitter tab itself...03:03
neuro8And it has a min + a max03:03
neuro8Was trying to declare these as references03:04
neuro8Wnd*              m_top_wnd;03:04
neuro8        Wnd*              m_btm_wnd;03:04
neuro803:04
GeofftheMedionot sure what you mean by "trying to declare ... as references"03:05
neuro8Sorry03:05
neuro8The Splitter class is implementing/respecting MinUsableSize03:06
GeofftheMedioyou might want to make things a bit more generic though, to allow left-right splitters as well03: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
neuro8The last two arguments I'm passing in are references to the two GG::Wnd objects I want to "split"03:07
GeofftheMediothose don't need to be in the constructor...03:07
neuro8I think I implemented it so you could make it a horizontal splitter if you change it to GG::HORIZONTAL in the arguments03:07
GeofftheMediolike Layout, you can have an Add function that takes a Wnd* and an index for whether it's the left/top or right/bottom Wnd03:08
neuro8Ah03:08
neuro8I made an assumption that a splitter would always split 2 wnds03:08
GeofftheMedioit 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 constructing03:09
GeofftheMedioTHAT said, it should be possible to put a Splitter or Layout on one side of the splitter, and have all the contents react appropriately03:10
neuro8Hm03:11
GeofftheMediothat shouldn't be much / any extra work, though, as both Splitter and Layout are derived from Wnd03:11
neuro8So 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
neuro8void Add(Wnd* wnd, std::size_t index);03:12
GeofftheMedioprobably keep the same size in pixels, not % position03:13
neuro8Ok03:17
neuro8Should I define custom WndPosition struct for the for positions? or just use like an int for an index03:18
GeofftheMedionot sure what you mean03:18
neuro8This is in Layout.h to keep track of all the Wnd's03:20
neuro8 std::map<Wnd*, WndPosition>     m_wnd_positions;03:20
neuro8But WndPosition is a struct defined in it with a few properties to keep track of these wnds03:21
*** STalKer-X has quit IRC03:22
neuro8I think I can just do this03:23
neuro8std::map<Wnd*, int>     m_wnd_positions;03:23
neuro8Then in my Add method do this :03:23
neuro8m_wnd_positions[wnd] = index;03:23
GeofftheMedioThe left / top Wnd will always be at (0,0), won't it?  And the right / bottom Wnd always positioned relative to the splitter03:23
GeofftheMedioI don't really know what WndPosition is used for in Layout, though03:24
GeofftheMediooh.. it's mostly just to keep track of what cell of the Layout a Wnd is in03:25
GeofftheMedioor cells03:25
GeofftheMedioand its alignment, and original position and size03:26
neuro8Right03:27
GeofftheMedioYou 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_wnd03:27
GeofftheMediodont' see need for a map for what is always two pointers...03:27
neuro8So actually have two Wnd* values?03:27
neuro8huh03:27
GeofftheMedioseems reasonable03:27
neuro8Cool03:28
neuro8I was makin' that m_wnd_positions map work but that makes much more sense03:28
GeofftheMedioYou 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 has03:31
neuro8Ah...03:35
neuro8So a custom struct to contain alignment, position, size03:35
neuro8That seems more complex but probably more useful.03:36
neuro8Add an assert, and some checks that will throw errors if the Wnd's are already occupied. Compiling03:36
GeofftheMedioyou 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
neuro8I'm just going to keep going with two Wnd* references03:39
GeofftheMedioI meant for storing alignment and original position and size03:42
neuro8Wow build succeeded!03:43
GeofftheMedio(current position and size don't need to be stored... they're available from the two Wnd*)03:43
neuro8Yeah actually it would be good to keep those...03:43
neuro8I should call it something else though, right?03:46
neuro8It's defined as " struct GG_API WndPosition"03:46
GeofftheMediothe current one is a private struct within Layout... you can have a similarly-named struct within Splitter without problem03:48
GeofftheMediobut sure, call it something else to be safe03:48
*** STalKer-X has joined #freeorion03:49
neuro8Weird. Getting a "Timed out while attempting to connect to server"03:53
GeofftheMediorestart program and try again... sometimes networking has hiccups03:56
CIA-19FreeOrion: 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
neuro8Rad. That worked03:59
neuro8lol well my Splitter's THERE, it's just not doing anything.04:01
neuro8Also, it's at the bottom of the FleetWnd04:01
neuro8Aright man. Have a good night / day04:29
GeofftheMedionight here04:31
neuro8Welp, yeah, have a good night. Made some good progress on this but I need to crash04:38
*** neuro8 has quit IRC05:01
*** GeofftheMedio has quit IRC06:07
*** GeofftheMedio has joined #freeorion06:31
CIA-19FreeOrion: geoffthemedio * r4006 /trunk/FreeOrion/ (12 files in 3 dirs): (log message trimmed)09:52
CIA-19FreeOrion: -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-19FreeOrion: -Updated all uses of UI sounds and default option settings to use absolute09:52
CIA-19FreeOrion: pathes instead of relative (to Sound directory) pathes. Sound directory is now09:52
CIA-19FreeOrion: mainly (just?) the default location where to search for such files when09:52
CIA-19FreeOrion: modifying the options.09:52
CIA-19FreeOrion: -Tweaked an exception catching debug output line.09:52
*** VargaD has joined #freeorion13:04
*** VargaD has quit IRC15:14
*** StrangerDanger has quit IRC18:10
*** theTroy has joined #freeorion19:06
*** theTroy has quit IRC21:14
*** GeofftheMedio_ has joined #freeorion21:58
*** GeofftheMedio has quit IRC22:00
*** GeofftheMedio_ is now known as GeofftheMedio22:00
*** GeofftheMedio_ has joined #freeorion22:13
*** GeofftheMedio has quit IRC22:16
*** GeofftheMedio_ is now known as GeofftheMedio22:16
CIA-19FreeOrion: geoffthemedio * r4007 /trunk/FreeOrion/ (CMakeLists.txt UI/FleetWnd.cpp):23:21
CIA-19FreeOrion: -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-19FreeOrion: -Minor tweak to CMakeLists.txt to show required boost version in an error message, as suggested on forums.23:21
CIA-19FreeOrion: 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!