Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - SDH

#1
Feature requests / [v0.6] setTextStyle
02 February 2015, 16:40:04
i just want your permission to pull request with setting text style, everywhere is sf::Text present.
Ofc i didn't done it yet.
#2
I would love to see function like (not probably the only one):

Code (cpp) Select
inline void Picture::loadFromTexture(sf::Texture& _texture)
{
     m_texture = _texture;
}


because without it i can't use v0.7, otherwise you will wait seconds to see any page in my game...
Ofc i can write it to your code but i think many users will appreciate this, because i'm not probably
the only one with Resource Managers ...
And i'm not the only one who want to manage resources by myself.

EDIT:

Code (cpp) Select
void setTextFont(std::shared_ptr<sf::Font> font);

Can you please add option with only sf::Font&, otherwise there is need to use std::make_shared.
Most of the tut's on net uses res-managers with & return type and most of the begginers
don't know anything about smart pointers.

example:

using your code:
Code (cpp) Select
#include <memory>
sf::Font m_font;
m_font.loadFromFile("my_font.ttf")
m_label.setTextFont(std::make_shared<sf::Font>(m_font));


more readable version for begginers:
Code (cpp) Select

sf::Font m_font;
m_font.loadFromFile("my_font.ttf")
m_label.setTextFont(m_font);


As in my last thread: https://forum.tgui.eu/index.php?topic=280.0
i can do the code for you, because of this:
Quote from: texus on 01 October 2014, 22:29:31
But seeing how much work I'm going to get with my university projects, it will probably be for July next year. Most v0.7 progress will be delayed till next year since I simply don't have the time for it.
#3
General Discussion / [vs12] 0.7 warnings
02 February 2015, 10:24:36
Visual Studio 2013
tgui 0.7 (latest from github)
sfml 2.2 (latest from https://www.nightlybuilds.ch)
cmake 2.8

Release Build:

Code (cpp) Select
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
1>  Checking Build System
1>  CMake does not need to re-run because C:/Users/SHADOW/Desktop/TGUI-0.7-dev/bin/CMakeFiles/generate.stamp is up-to-date.
1>  CMake does not need to re-run because C:/Users/SHADOW/Desktop/TGUI-0.7-dev/bin/src/TGUI/CMakeFiles/generate.stamp is up-to-date.
2>------ Build started: Project: tgui, Configuration: Release Win32 ------
2>  Building Custom Rule C:/Users/SHADOW/Desktop/TGUI-0.7-dev/src/TGUI/CMakeLists.txt
2>  CMake does not need to re-run because C:\Users\SHADOW\Desktop\TGUI-0.7-dev\bin\src\TGUI\CMakeFiles\generate.stamp is up-to-date.
2>  Button.cpp
2>  Canvas.cpp
2>  ChatBox.cpp
2>  Checkbox.cpp
2>  ChildWindow.cpp
2>  ClickableWidget.cpp
2>  Clipboard.cpp
2>..\..\..\src\TGUI\Clipboard.cpp(86): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\string.h(112) : see declaration of 'strcpy'
2>  ComboBox.cpp
2>  Container.cpp
2>  EditBox.cpp
2>  Global.cpp
2>  Grid.cpp
2>  Gui.cpp
2>  Knob.cpp
2>  Label.cpp
2>  Layout.cpp
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0(532): warning C4503: 'std::_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>>::_Insert_hint' : decorated name length exceeded, name was truncated
2>          with
2>          [
2>              _Kty=tgui::Widget *
2>  ,            _Ty=std::map<tgui::LayoutChangeTrigger,std::map<const tgui::Layout *,std::function<void (void)>,std::less<const tgui::Layout *>,std::allocator<std::pair<const tgui::Layout *const ,std::function<void (void)>>>>,std::less<tgui::LayoutChangeTrigger>,std::allocator<std::pair<const tgui::LayoutChangeTrigger,std::map<const tgui::Layout *,std::function<void (void)>,std::less<const tgui::Layout *>,std::allocator<std::pair<const tgui::Layout *const ,std::function<void (void)>>>>>>>
2>  ,            _Pr=std::less<tgui::Widget *>
2>  ,            _Alloc=std::allocator<std::pair<tgui::Widget *const ,std::map<tgui::LayoutChangeTrigger,std::map<const tgui::Layout *,std::function<void (void)>,std::less<const tgui::Layout *>,std::allocator<std::pair<const tgui::Layout *const ,std::function<void (void)>>>>,std::less<tgui::LayoutChangeTrigger>,std::allocator<std::pair<const tgui::LayoutChangeTrigger,std::map<const tgui::Layout *,std::function<void (void)>,std::less<const tgui::Layout *>,std::allocator<std::pair<const tgui::Layout *const ,std::function<void (void)>>>>>>>>>
2>          ]
2>  ListBox.cpp
2>  MenuBar.cpp
2>  MessageBox.cpp
2>  Panel.cpp
2>  Generating Code...
2>  Compiling...
2>  Picture.cpp
2>  ProgressBar.cpp
2>  RadioButton.cpp
2>  Scrollbar.cpp
2>  Signal.cpp
2>  Slider.cpp
2>  SpinButton.cpp
2>  Tab.cpp
2>  TextBox.cpp
2>..\..\..\src\TGUI\TextBox.cpp(424): warning C4244: '=' : conversion from 'float' to 'unsigned int', possible loss of data
2>  Texture.cpp
2>  TextureManager.cpp
2>  ThemeFileParser.cpp
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtree(836): warning C4503: 'std::_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>>::_Insert_hint' : decorated name length exceeded, name was truncated
2>          with
2>          [
2>              _Kty=std::string
2>  ,            _Ty=std::map<std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>,std::less<std::string>,std::allocator<std::pair<const std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>>>>
2>  ,            _Pr=std::less<std::string>
2>  ,            _Alloc=std::allocator<std::pair<const std::string,std::map<std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>,std::less<std::string>,std::allocator<std::pair<const std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>>>>>>
2>          ]
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtree(836): warning C4503: 'std::_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>>::_Insert_at' : decorated name length exceeded, name was truncated
2>          with
2>          [
2>              _Kty=std::string
2>  ,            _Ty=std::map<std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>,std::less<std::string>,std::allocator<std::pair<const std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>>>>
2>  ,            _Pr=std::less<std::string>
2>  ,            _Alloc=std::allocator<std::pair<const std::string,std::map<std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>,std::less<std::string>,std::allocator<std::pair<const std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>>>>>>
2>          ]
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtree(836): warning C4503: 'std::_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>>::_Insert_nohint' : decorated name length exceeded, name was truncated
2>          with
2>          [
2>              _Kty=std::string
2>  ,            _Ty=std::map<std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>,std::less<std::string>,std::allocator<std::pair<const std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>>>>
2>  ,            _Pr=std::less<std::string>
2>  ,            _Alloc=std::allocator<std::pair<const std::string,std::map<std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>,std::less<std::string>,std::allocator<std::pair<const std::string,std::vector<std::pair<std::string,std::string>,std::allocator<std::pair<std::string,std::string>>>>>>>>
2>          ]
2>  Tooltip.cpp
2>  Transformable.cpp
2>  Widget.cpp
2>  AnimatedPicture.cpp
2>  Slider2d.cpp
2>  SpriteSheet.cpp
2>  Generating Code...
2>     Creating library C:/Users/SHADOW/Desktop/TGUI-0.7-dev/bin/lib/Release/tgui.lib and object C:/Users/SHADOW/Desktop/TGUI-0.7-dev/bin/lib/Release/tgui.exp
2>  tgui.vcxproj -> C:\Users\SHADOW\Desktop\TGUI-0.7-dev\bin\lib\Release\tgui.dll
3>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------
3>  Building Custom Rule C:/Users/SHADOW/Desktop/TGUI-0.7-dev/CMakeLists.txt
3>  CMake does not need to re-run because C:\Users\SHADOW\Desktop\TGUI-0.7-dev\bin\CMakeFiles\generate.stamp is up-to-date.
3>  Build all projects
4>------ Skipped Build: Project: INSTALL, Configuration: Release Win32 ------
4>Project not selected to build for this solution configuration
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 1 skipped ==========


If you have no time then i can repair most of those warnings.
#4
Help requests / tgui::Picture callback
17 December 2014, 10:18:52
Visual Studio 2013
sfml 2.2
tgui 0.6.6

I think code for this isn't needed.
When you will create tgui::Picture::Ptr object you can bind a number to callback but it won't respond.

m_picture = tgui::Picture::Ptr(*fw::g_gui);
m_picture -> bindCallback(tgui::Picture::LeftMouseClicked);
m_picture -> setCallbackId(1);


tgui::Button with callback works, but tgui::Picture don't.
#5
Help requests / ::Ptr in class = no text
07 December 2014, 09:52:42
Example:

class CGuiBasePage
{
     public:
          virtual void construct();
          virtual void destruct();
}

class CButton : public CGuiBasePage
{
     private:
          tgui::Button::Ptr m_button;

     public:
          void construct();
          void destruct();
};

std::unique_ptr<CGuiBasePage> m_page;
m_page = std::move(std::make_unique<CGuiBasePage>());

main.cpp
m_page -> construct();


result of this code is that i can't see any text in Button or EditBox.

Using:
Visual Studio 2013
sfml 2.1
tgui 0.6.6
everything is compiled by me, but problem is reproducable even on sfml build from your website.
#6
Feature requests / some changes
08 June 2014, 11:57:49
Well Hello,

I today started working with TGUI and i saw some things :D like:

setPosition(sf::Vector2f)
setSize(float,float)

can you change it to sf::Vector2 ?
because having functions with 2x floats & sf::Vector2f is confusing.

setText(sf::String)
to std::string ?
because sf::String crashes on empty string :
https://github.com/LaurentGomila/SFML/issues/389

setGlobalFont(std::string)
add support for sf::Font, because peoples like me have their own resources manager :)
and i know its just one font but, still.

feel free to insult [use criticism on] me :D