FleetWnd: Adding divider between data panels

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
User avatar
pd
Graphics Lead Emeritus
Posts: 1924
Joined: Mon Mar 08, 2004 6:17 pm
Location: 52°16'N 10°31'E

Re: FleetWnd: Adding divider between data panels

#16 Post by pd »

Thanks, good to know.

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: FleetWnd: Adding divider between data panels

#17 Post by neuro »

Hi pm,

I've been incredibly busy working on my company, and March + April + May have been hectic, just making sure it's stable.

All the groundwork has been discussed with Tyreth and myself, but unfortunately, I haven't had much free time to work on it. I spoke with Geoff, and think I can carve out time starting June 1st - June 18th to make actual progress on it.

It's been itching me, and I told G I personally felt bad that there hasn't been any progress made, especially since I worked hard to earn the trust of the community. Plus, one of my personal New Year's Resolutions is to contribute to an Open Source project.

So that's the status, been discussed, code has been stubbed out, just haven't sat down, done it, and tested.

neuro8

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: FleetWnd: Adding divider between data panels

#18 Post by Geoff the Medio »

neuro wrote:All the groundwork has been discussed with Tyreth and myself...
Tyreth, or tzlaine?

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: FleetWnd: Adding divider between data panels

#19 Post by neuro »

Sorry, tzlaine, on his GG library and the best way to make the new class. I posted some of our notes in an earlier post.

If there's a developer interested in tackling it earlier, I wouldn't mind coaching them... though point of pride is in me finishing it. :) Until then, I'm working with my team to get our apps / sites out prior to my quasi-vaca June 1st.

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: FleetWnd: Adding divider between data panels

#20 Post by neuro »

Hey All,

This is a GG question for integrating the new Splitter class.

Basically, I'm working on the Splitter.cpp class for integration into FreeOrion.

What I'm trying to do:
Understand GG better by running through the tutorials in the "tutorials" folder of GG. By understanding GG, I think it'll help me understand the Splitter integration.

What I'm having issues with:
Building / seeing the output for the tutorials: minimal, controls, serialization, adam, and eve. I use cmake-gui to Configure + Generate the XCode project to try this.

My process:
I downloaded the GG including the "tutorial" files. I ran cmake-gui to Configure the classes so they can build a project in XCode. I've been having a bit of trouble generating them. When I try to Configure, after setting the "BOOST_INCLUDE_DIR" to this "/Users/dominictancredi/Documents/freeorion-sdk/FreeOrion/GG/tutorial/src/boost", I get this error:

-- Configuring Tutorials
CMake Error at /Applications/CMake 2.8-1.app/Contents/share/cmake-2.8/Modules/FindBoost.cmake:522 (FILE):
file Internal CMake error when trying to open file:
/Users/dominictancredi/Documents/freeorion-sdk/FreeOrion/GG/tutorial/src/boost/boost/version.hpp
for reading.
Call Stack (most recent call first):
CMakeLists.txt:5 (find_package)


CMake Error at /Applications/CMake 2.8-1.app/Contents/share/cmake-2.8/Modules/FindBoost.cmake:535 (MATH):
math cannot parse the expression: " / 100000": syntax error, unexpected
exp_DIVIDE, expecting exp_OPENPARENT or exp_NUMBER (2)
Call Stack (most recent call first):
CMakeLists.txt:5 (find_package)


CMake Error at /Applications/CMake 2.8-1.app/Contents/share/cmake-2.8/Modules/FindBoost.cmake:536 (MATH):
math cannot parse the expression: " / 100 % 1000": syntax error, unexpected
exp_DIVIDE, expecting exp_OPENPARENT or exp_NUMBER (2)
Call Stack (most recent call first):
CMakeLists.txt:5 (find_package)


CMake Error at /Applications/CMake 2.8-1.app/Contents/share/cmake-2.8/Modules/FindBoost.cmake:537 (MATH):
math cannot parse the expression: " % 100": syntax error, unexpected
exp_MOD, expecting exp_OPENPARENT or exp_NUMBER (2)
Call Stack (most recent call first):
CMakeLists.txt:5 (find_package)


Could NOT find Boost
Configuring incomplete, errors occurred!


Ok, so that's coming from this in CMakeLists.txt:

Code: Select all

find_package(Boost ${MINIMUM_BOOST_VERSION} COMPONENTS serialization)
I can't find the locations for the serialization library files (I suspect because it wasn't built / used in FO):
Boost_SERIALIZATION_LIBRARY_DEBUG
Boost_SERIALIZATION_LIBRARY_RELEASE

So after testing / scratching my head, scrapping, rebuilding, testing, etc...

I comment out the cmake line looking for boost, since it seems to only be used for Serialization.
Re-run cmake-gui and it Configures and Generates an XCode project for me!
But when I try to build, there's no real output for me to test the "minimal" or any other project, just the CMakeLists.txt in the folder.

My Questions on Process:
Am I missing something in my cmake-gui configure / XCode generate settings?
Is there a command in the command-line I can use to generate the minimal (et al) output?
Should I just abandon running through the tutorials on GG for another day, and focus on running / testing Splitter?

I'm finally able to put some time on this, so any help or advice would be...er helpful.

Thanks!

Neuro8

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: FleetWnd: Adding divider between data panels

#21 Post by Geoff the Medio »

neuro wrote:What I'm trying to do:
Understand GG better by running through the tutorials in the "tutorials" folder of GG. By understanding GG, I think it'll help me understand the Splitter integration.
I don't know how up-to-date and complete the GG tutorial stuff is, but I suspect not very, and I wouldn't spend much time looking at it. There are many more examples of GG in use in the FreeOrion code.
What I'm having issues with:
Building / seeing the output for the tutorials: minimal, controls, serialization, adam, and eve.
You don't need to be using serialization of GG controls, adam or eve stuff for FreeOrion purposes.
My process:When I try to Configure, after setting the "BOOST_INCLUDE_DIR" to this "/Users/dominictancredi/Documents/freeorion-sdk/FreeOrion/GG/tutorial/src/boost"
My FreeOrion directory tree doesn't have a src directory under GG/tutorial. And even if it did, I wouldn't expect the whole Boost library include tree would be stuck under the GG tutorial directory for some reason... The BOOST_INCLUDE_DIR needs to point to the actual full Boost include directory, which is not a subdirectory of FreeOrion or GG, but is probably a separate directory. In the Windows SDK, it's located in FreeOrion_SDK/Boost/include . I'm not sure how the MacOSX SDK is set up, but I'd guess something similar.

My Questions on Process:Should I just abandon running through the tutorials on GG for another day, and focus on running / testing Splitter?[/quote]
Even if you didn't have any CMake issues, I'd suggest not bothering with GG tutorials, and just diving into FreeOrion code that uses GG, and looking at the GG source and header and asking questions when necessary.

You also probably don't need to use CMake, as there is a MacOSX SDK that's almost up to date, which contains an XCode project. (I think two files need to be added that didn't exist the last time it was updated). tzlaine likes CMake for its ability to work on all system and only require one update of build files, but issues like this, where it doesn't "just work" make me less fond, as long as there is someone to actually keep the per-OS build files updated...

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: FleetWnd: Adding divider between data panels

#22 Post by neuro »

Geoff the Medio wrote: I don't know how up-to-date and complete the GG tutorial stuff is, but I suspect not very, and I wouldn't spend much time looking at it. There are many more examples of GG in use in the FreeOrion code.

Ok! Sounds good then.
Geoff the Medio wrote:You don't need to be using serialization of GG controls, adam or eve stuff for FreeOrion purposes.
Right I was just trying to get it to build so I can see GG in action on its own
My FreeOrion directory tree doesn't have a src directory under GG/tutorial. And even if it did, I wouldn't expect the whole Boost library include tree would be stuck under the GG tutorial directory for some reason... The BOOST_INCLUDE_DIR needs to point to the actual full Boost include directory, which is not a subdirectory of FreeOrion or GG, but is probably a separate directory. In the Windows SDK, it's located in FreeOrion_SDK/Boost/include . I'm not sure how the MacOSX SDK is set up, but I'd guess something similar.
Right, my bad, initially I was using the boost lib in the following location:
/Users/dominictancredi/Documents/freeorion-sdk/FreeOrion/Xcode/dep/local/include
But it wasn't working for same issue described above. I tried downloading a fresh install of boost but now I'm thinking I just spent waaay too much time trying to solve this whole build thing out.
You also probably don't need to use CMake, as there is a MacOSX SDK that's almost up to date, which contains an XCode project. (I think two files need to be added that didn't exist the last time it was updated). tzlaine likes CMake for its ability to work on all system and only require one update of build files, but issues like this, where it doesn't "just work" make me less fond, as long as there is someone to actually keep the per-OS build files updated...
I was using the MacOSX XCode project to generate my FreeOrion builds. But there wasn't one for GG hence the attempt to build one. Don't let me influence either camp, I think my experience using CMake resulted in a faulty process.

I'll just try to integrate the Splitter class directly and see how it goes.

Thanks for the quick response!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: FleetWnd: Adding divider between data panels

#23 Post by Geoff the Medio »

neuro wrote:I was using the MacOSX XCode project to generate my FreeOrion builds. But there wasn't one for GG hence the attempt to build one.
How does the FreeOrion OSX XCode project handle GG stuff then?

On Windows, the solution file contains projects for freeorion (human client), freeorionca (AI client), freeoriond (server), and GG, GG-Ogre and the GG-Ogre OIS input plugin. This results in DLLs for the three GG projects, which are dependencies of the FreeOrion project, but which should also be usable independently, as if they were built on their own.

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: FleetWnd: Adding divider between data panels

#24 Post by neuro »

5 months later...

Hi All!

I've finished my Splitter class, and it's ready for me to test out, play with styles, etc. However, I can't seem to get the build to work. I've been able to (finally) compile without error (lotta property/method reviewing), but when I build I get a linking error.

Here's the code:

FleetWnd.h: line 7

Code: Select all

#include <GG/Splitter.h>
FleetWnd.h: line 174

Code: Select all

GG::Splitter*       m_fleet_splitter;
FleetWnd.cpp: lines 2259 - 2271

Code: Select all

/* NEW CODE BY DT */
    
    // create splitter and attach between list box and detail panel
    // divide fleet windows
    m_fleet_splitter = new GG::Splitter(GG::X0, GG::Y0, GG::X(300), GG::Y(14));
//    m_fleet_splitter = new GG::Splitter(GG::X0, GG::Y0, GG::X(300), GG::Y(14), GG::VERTICAL, GG::CLR_GRAY, GG::INTERACTIVE);
    
    //GG::Connect(m_fleet_splitter->SignalSplit)
    //AttachChild(m_fleet_splitter);
    
    /* END NEW CODE BY DT */
Here's the error:

ld: warning: directory '/Users/dominictancredi/Desktop/Games/freeorion-sdk/FreeOrion/Xcode/dep/local/lib/graphviz' following -L not found
ld: warning: directory '"/Users/dominictancredi/Desktop/Games/freeorion-sdk/FreeOrion/Xcode/dep/local/lib"' following -L not found
ld: warning: directory '"/Users/dominictancredi/Desktop/Games/freeorion-sdk/FreeOrion/Xcode/dep/local/lib/bullet"' following -L not found
ld: warning: directory '"/Users/dominictancredi/Desktop/Games/freeorion-sdk/FreeOrion/Xcode/dep/lib"' following -L not found
ld: warning: directory '"/Users/dominictancredi/Desktop/Games/freeorion-sdk/FreeOrion/Xcode/dep/Frameworks"' following -F not found

Undefined symbols:
"GG::Splitter::Splitter(GG::X, GG::Y, GG::X, GG::Y)", referenced from:
FleetWnd::Init(int) in FleetWnd.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


My class lives in FreeOrion/GG/GG/Splitter.h and FreeOrion/GG/src/Splitter.cpp respectively and is attached. It's not yet tweaked but should be able to work... I've commented out the attaching code in FleetWnd just to try to get an instantiation of it.
I don't know if I need to recompile the GG build to include this or not... I've had issues with recompiling GG before (see earlier posts in this thread) so any thoughts from the community would help.

Here's hoping I get this done by the end of the year. It'd be nice to have contributed 2 fixes to the game.

B,
neuro
Attachments
Splitter.h
(6.75 KiB) Downloaded 65 times
Splitter.cpp
(8 KiB) Downloaded 66 times

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: FleetWnd: Adding divider between data panels

#25 Post by Geoff the Medio »

neuro wrote:I don't know if I need to recompile the GG build to include this or not... I've had issues with recompiling GG before (see earlier posts in this thread) so any thoughts from the community would help.
If you've added a new .cpp file, you're going to need to compile that file to use the code in it. If you're getting linker errors about undefined symbols of the class in question, it's probably because the file isn't being compiled, or isn't being linked into a library (such as GG) where it can be accessed later. Since the new file is an addition to GG, it would make most sense to add the file to your build of GG, but it might also work to add the Splitter.cpp file to FreeOrion's build just for testing purposes.

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: FleetWnd: Adding divider between data panels

#26 Post by neuro »

Since the new file is an addition to GG, it would make most sense to add the file to your build of GG, but it might also work to add the Splitter.cpp file to FreeOrion's build just for testing purposes.
Good call. I drag-dropped the Splitter.cpp file into my Target/GG/Compile Sources area in XCode and ran build...got a whole bunch of new errors / issues but none linking, which is great!

Turns out I had a LOT more work to do... fixing properties, method definitions, Signal event hookups...the works.
But I finally got it to show up on the FleetWnd! That's exciting.

Now I'm working on actually POSITIONING it properly. Then the left-click-and-drop signaling... but at least I'm able to see the results and test it out.

Thanks! You should hear more progress on it.

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: FleetWnd: Adding divider between data panels

#27 Post by neuro »

Hey All!

So 9 months later I think I have this new GG::Splitter ready to demo.

You check out screenshots of it here:
http://domandtom.com/freeorion/_splitter/splitter_9.png
http://domandtom.com/freeorion/_splitte ... ter_10.png
http://domandtom.com/freeorion/_splitte ... ter_11.png

I might need artwork since it's using default background and tab for selection.

But it splits both windows in the FleetWnd, is draggable, and looks great if you resize the window.

Still debugging it a bit but it should be coming soon (er than another 9 months...)

Just wanted to post progress! And looking forward to my next task.

User avatar
pd
Graphics Lead Emeritus
Posts: 1924
Joined: Mon Mar 08, 2004 6:17 pm
Location: 52°16'N 10°31'E

Re: FleetWnd: Adding divider between data panels

#28 Post by pd »

Excellent! Could you clarify what you need exactly? What resolution?

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: FleetWnd: Adding divider between data panels

#29 Post by eleazar »

Cool.

I'd slim the divider down a little, and style it like this:

Most of these window bits are vectors created by the game right?
Attachments
window slider.png
window slider.png (34.84 KiB) Viewed 1308 times

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: FleetWnd: Adding divider between data panels

#30 Post by neuro »

Not sure what I need... It's 14 px in height right now. I can change that.

The background is black and the tab itself is "GG::Grey".

Remember that 3 dot png you proposed a while back? If you send me a private message with a link to it I can download it and replace the tab with that.

Geoff said make everything in GL but I'm not sure what that means.

Give me a pixel width and any artwork you want. Just remember it's a GG component so it'll be used in a variety of windows and meant to handle vertical as well as horizontal splitting. I'm hoping, if it proves popular, it can be used in other ux/ui views. The 3 dots version should work...

EDIT:

Just reread the above post. I think I'll have to make the dots dynamically. Yes, most of the view code I've read is meant to draw elements dynamically (eg vector) for border, background, lines, etc. I'll see about doing that and centering them. Might have to find an example somewhere that draws dots.

Post Reply