Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: cpGUI - A new object oriented GUI toolkit based on SFML 1.5  (Read 54849 times)

0 Members and 3 Guests are viewing this topic.

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #60 on: January 06, 2010, 09:36:38 pm »
It appears you forgot to add
Code: [Select]
#include <stdexcept> to cpGUI_base.h and cpGUI.h. Did nobody else notice?

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #61 on: February 16, 2010, 02:00:25 am »
Hello forrestcupp, and thanks for making this! Awesome job!

I think I found a small bug: If you have a Drop Down Box with scroll bar, and then scroll it by left-clicking the up/down arrows, or by dragging the scroll-position-indicator-thingie (Isn't that the official name of such a thing?), then the drop-down closes on mouse-up.

So in effect, you can only really scroll it with the mouse wheel.

[EDIT]
Um, further investigation shows that this is probably not a bug, but rather a me that should read the manual better... Sorry.  :oops:

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #62 on: February 27, 2010, 08:54:33 pm »
Hi again,

After playing about with cpGUI for a bit, I decided to add the possibility to change the color of the button and arrow on the drop down object.
Here is the patch:
Code: [Select]
// For the header

void SetFont(std::string filename, unsigned int size);
void SetBackgroundColor(sf::Color color);
void SetDownButtonBackgroundColor(sf::Color color);
Code: [Select]
// Implementation

// Sets the color and outline color of the down arrow.
void cpDropDownBox::SetDownArrowColor(sf::Color color, sf::Color outlineColor)
{
sf::Shape newArrow;

newArrow.AddPoint(PosX+Width-Height+Height/3, PosY+Height/3, color, outlineColor);
newArrow.AddPoint(PosX+Width-Height+Height*2/3, PosY+Height/3, color, outlineColor);
newArrow.AddPoint(PosX+Width-Height+Height/2, PosY+Height*2/3, color, outlineColor);
newArrow.SetOutlineWidth(1.f);

downArrow = newArrow;
}

// Sets the color of the down arrow.
// The outline color is automtically set to match the background.
// Warning: The outline color will not be kept in sync if the background changes!
void cpDropDownBox::SetDownArrowColor(sf::Color color)
{
SetDownArrowColor(color, btnBackground);
}

// Sets the background color of the down button.
void cpDropDownBox::SetDownButtonBackgroundColor( sf::Color color )
{
downBtn->SetBackgroundColor( color );
}
Oh, and I hereby release the code into the public domain, so anyone can use it, anyway they like. :)

EDIT:

And here is one for the wish list: A pure cpLabel object with the usual abilities to set colors and font, and so on. That would be very useful!

nulloid

  • Full Member
  • ***
  • Posts: 134
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #63 on: April 05, 2010, 02:01:09 am »
I ran into a small bug: when I set the position of a cpImageButton, the sprite doesn't move with the button. Very easy to fix it, just add this line to the code:

Code: [Select]
/// Sets the image button's position coordinates in the window
void cpImageButton::SetPosition(float posx, float posy)
{
cpObject::SetPosition(posx, posy);
sprite.SetPosition(posx + 1, posy + 1); //This is the additional line
CreateRects("");
}

m0refi4

  • Newbie
  • *
  • Posts: 7
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #64 on: April 20, 2010, 07:02:07 pm »
Hm I somehow can't get cpGUI to run. I always get undefined references. Would be great if someone could help me out here  :?

nulloid

  • Full Member
  • ***
  • Posts: 134
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #65 on: April 22, 2010, 12:38:09 am »
Read the wiki. It says: "When creating your own project, make sure to put the cpGUI.h & cpGUI.cpp files in your project and #include „cpGUI.h“. " That's all you need. At least it worked for me ;)

m0refi4

  • Newbie
  • *
  • Posts: 7
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #66 on: April 22, 2010, 12:43:37 am »
Quote from: "nulloid"
Read the wiki. It says: "When creating your own project, make sure to put the cpGUI.h & cpGUI.cpp files in your project and #include „cpGUI.h“. " That's all you need. At least it worked for me ;)


Well Ive done the most stupid thing ever since I added all the source files and headers to my project and wondered why I'd get so many multiple definitions..

Works fine now, thanks ;p

forrestcupp

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #67 on: April 22, 2010, 03:11:27 pm »
Quote from: "m0refi4"
Quote from: "nulloid"
Read the wiki. It says: "When creating your own project, make sure to put the cpGUI.h & cpGUI.cpp files in your project and #include „cpGUI.h“. " That's all you need. At least it worked for me ;)


Well Ive done the most stupid thing ever since I added all the source files and headers to my project and wondered why I'd get so many multiple definitions..

Works fine now, thanks ;p
I answered your pm before I saw what you did here.

cpGUI.h & cpGUI.cpp include all the classes needed for everything.  The other header and cpp files are for the people who want to pick and choose what controls they want to use to streamline their program.  Some people didn't want to have to have everything in their program when they are only using one or two controls.

I'm glad you figured it out.

Recruit0

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Status Update
« Reply #68 on: June 24, 2010, 01:41:20 am »
Status Update
  • The wiki has been updated.
  • If you (the reader) don't already know, pdusen and I have taken up the project.
  • We will support cpGUI-1.5 until we release cpGUI-1.6. We've released an update to cpGUI-1.5 that fixes compiler problems and ensures that it runs with SFML-1.6. I/we will go through this thread, check for bug reports and fix them when I/we have time.
  • Estimated release date for cpGUI-1.6-beta: August 2010. We are currently rewriting the API. Most of the time will be spent designing it (which is already evident). I estimate about %40 of the old code to be reusable (e.g. FontMap).

We will get around to creating a mailing list or other form of public communication later. For now this forum should be used to contact us if you want to reach us.

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #69 on: July 07, 2010, 10:42:24 pm »
Hi, nice to see someone picked it up.

I played around with the code quite a bit, and added a bunch of features, so I was thinking maybe you new people would like to have my files?
Just drop me a PM if you do. The changes should be well enough documented.

Oh, and see you back in action in about a year, forestcupp! Unless you get another one in the mean time... ;)

Recruit0

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #70 on: July 08, 2010, 05:16:50 pm »
We're primarily concerned with bug fixes for the old API since we're creating a new one. What features did you add?

carsaxy

  • Newbie
  • *
  • Posts: 11
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #71 on: October 30, 2011, 12:33:41 pm »
Thanks!
Do I have to build this library with cmake before use it?