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

Messages - billarhos

#151
Help requests / Re: simulate button event clicked
31 October 2015, 19:05:39
thanks texus
#152
Help requests / simulate button event clicked
31 October 2015, 18:31:00
Hi, i am struggling to make a button get pressed from code. The reason i want this is because i have shorcuts to simulate button events.

Example:

if (event.key.code == sf::Keyboard::S)
  pPrintButton->setPressed();


Well, if i use "leftMouseReleased" function it works however the text color stays on a hover(whatever) state.
Is any cure for this?

#153
I have set size and in advance i have set autosize to false.



#154
General Discussion / label and background color
29 October 2015, 18:30:29
Hi (again)

well now i face something different. My label has a background color. 

pLabel->getRenderer()->setBackgroundColor(sf::Color(150, 150, 150, 255));

When the label has text to print the background color is visible. When the text is null the background color disappears! 

#155
Hi

I am trying to set different color on edit boxes when they are focused but can not find such a color parameter. On the other hand a texture with name
"m_textureFocused" is present.

Also i have realize that editboxes (maybe and other widgets) are not possible to receive focus (via pEditBox->focus();).
To make an edit box receive focus, you have first to click on it. After that it is focus able. In order to work around this, i have added
this code in my initialize function.

for (sf::Uint32 i = 0; i < EditBoxes::Count; i++)
{
mGui.add(pEditBoxes[i]);
pEditBoxes[i]->leftMousePressed(pEditBoxes[i]->getPosition().x + 5, pEditBoxes[i]->getPosition().y + 5);
}


Maybe just the carret is the problem thai is not blinking.
I do not use container or childwindow.

missing something?

thank you
#156
General Discussion / Re: setSize of tgui::Tab
24 October 2015, 07:45:23
That is great.

Forget to explain about 1000 value.  Some people use per 100 value. I use 1000. Lets say i set 50 for width and  form's width is 1280.

Then the actual width in pixels is 50 * 1280/1000 = 64 pixels

The maximum value i can insert is 1000. Lets say i set 1000.

Then we have 1000 * 1280 / 1000 = 1280 (it is the form's width.)

So whatever the original width-height of the form are or whatever the size would be by resize - stretch  all my widgets keep their ratio on form.





#157
General Discussion / Re: setSize of tgui::Tab
23 October 2015, 22:16:28
Of i see the same result here. It is because i use the function "tab->setTextSize(fontSize(16, width, height));"
in "onResize". All parts of tab should resize and this includes font resize. When you resize the window width to 200 then
font must be squeezed down. All programs have some limits that does not allow user for example to resize under 800.

I think i can understand what you a saying. My code works only for my program and behave not good if i set different text sizes in tabs. For example
if i set   "MyTab1",  "MyTab string is very big", for two tabs then i do not have the result i want. In other words i manage to resize tab widget because
i have some specific constants. All my texts have the same size of chars.

If i were you, i will start thinking in creating a setTabWidth function where the user will set the width of individual tab. For example if he set 30 for width and
he uses 3 tabs the the whole widget will get a 3*30 = 90 width. The texts should be align in center of each tab. In this way, i believe you can handle width much
better.

Hope i help. I want to help. In bottom line, you did all that hard work and we are very appreciate for this.

Hope i
#158
General Discussion / Re: setSize of tgui::Tab
23 October 2015, 19:56:24
Well, the problem arise when you resize the main form. (Maximize)

To see the difference comment those lines 80,81

//float dist = layoutWidth(38).getValue();
//tab->getRenderer()->setDistanceToSide(dist);

and the lines in OnResize()

//tab->setTextSize(fontSize(16, width, height));
//tab->getRenderer()->setDistanceToSide((float)layoutWidth(38).getValue());

Just test by toggling between maximize and normal window.
If you remove those lines, you can see how tgui::tab behaves normally. (It is not stretching when application get maximized)

All other widgets can resize as expected when i set pos and size but not for tab.
As i said in a previous reply i managed to make tab behave just any other widget by manipulatiing Setdistancetoside.


#159
General Discussion / Re: setSize of tgui::Tab
22 October 2015, 09:01:56
It is nothing more than a value. It is the wanted width of setDistanceToSide.

Here is the sample project i 've just made. https://www.mediafire.com/download/6zmwv08x5kinets/TguiTest.zip

thanks
#160
General Discussion / Re: setSize of tgui::Tab
21 October 2015, 17:53:54
My code work well no matter how many the items are.

here is a snipet:

tgui::Layout widthLayout = tgui::bindWidth(gui);

tgui::Layout Settings::layoutWidth(float width)
{
if (width > 1000.0f)
width = 1000.0f;

return widthLayout * width * / 1000.0f;
}
#161
General Discussion / Re: setSize of tgui::Tab
21 October 2015, 17:38:26
Well i had an idea and it is working just perfect!

Changing on resize window the setDistanceToSide it worked.

float dist = (float)Settings::handler()->layoutWidth(36).getValue();
pTabNumbers->getRenderer()->setDistanceToSide(dist);

maybe this will give you an idea....
#162
General Discussion / setSize of tgui::Tab
21 October 2015, 16:10:53
Well, i reach to a point that i would like to have a tab box aligned in my form center position. However this is not possible because setSize(const Layout& width, const Layout& height) function doing nothing at all.

All other widgets are positioning well on form resize.

Thanks

Bill


#163
General Discussion / opacity of a list box
14 October 2015, 19:46:35
hi again

changing list boxes  opacity does not applied to background image. Is it proper? Took a look at your source code of button-opacity vs listbox opacity and see that something
like 
         "getRenderer()->m_backgroundTexture.setColor({255, 255, 255, static_cast<sf::Uint8>(m_opacity * 255)});"

is missing.
#164
how silly i am...

thanks
#165
Hi

I am facing an issue here with tab (not critical because can easily go around this).

When i add a new tab like this "pTab->add("Tab1")" then connect function "(TabSelected") is triggering.

So i got a question. Is it proper?

thanks
#166
Ok fixed

thanks
#168
hi

i made a simple repro project. I include all necessary files in order to compile and run.

you can download from here: https://www.mediafire.com/download/sgndoqcbnhg6h2p/SfmlTest.zip

thank you
#169
Well

yes there is no linking problem. I link against the correct libs (debug with -d)
I compile tgui myself.
pTab is not a null pointer.
I will make a simple example and upload it to mediafire in this weekend (hold on)
Yes i get a call stack if i press retry button and the line that stops is : pGui->add(pWindow);

pGui is a "tgui::Gui *" and  pWindow is a "tgui::ChildWindow::Ptr"

i was wrong about "pWindow->add(pTab)"

As i said before if i remove  BackgroundColor and SelectedBackgroundColor from txt file and replace them with NormalImage and SelectedImage the i have no error.

thanks



#170
General Discussion / Re: Hi
08 October 2015, 23:56:46
Hi and Thanks
I do not believe i got a compatibility issue but i am not quite sure. I will check tomorrow.

I use dynamically linking and double check about debug and release libs and dlls
I am using community Visual Studio 2013

The error occur on this line "pWindow->add(pTab)" with the code on the first question.
If i use an empty png file and this lines
NormalImage       : "White.png" Part(0, 0, 60, 32) Middle(16, 0, 28, 32);
SelectedImage     : "White.png" Part(0, 32, 60, 32) Middle(16, 0, 28, 32);

then i got no error both in release and debug mode.




#171
General Discussion / assertion failed on debug
08 October 2015, 22:21:50
Hi
I got a strange debug assertion failed when i use this Tab

Tab
{
    BackgroundColor : rgba(180, 180, 180, 215);
    SelectedBackgroundColor : rgba(0, 110, 200, 130);
    TextColor : rgba(255, 255, 255, 215);
    SelectedTextColor : rgba(255, 255, 255, 245);
    BorderColor : rgba(240, 240, 240, 215);
    Borders : (1, 1, 1, 1);
}


The strange here is that when i run in release it is working just fine.
The assertion is in debug.




#172
General Discussion / Re: Label performance
25 September 2015, 13:28:41
Ok,

At the end sure i will set my app to 60 frames. Is that right now i make some tests.
I understand also about non-linear scaling of fps.

Thanks for the detailed explanation.
#173
General Discussion / Re: Label performance
25 September 2015, 12:48:00
I do not talk about general 1000 frames but that i gain 1000 frames.

Let me rephrase.

if i use "sf::Text labels[21]"

instead of "tgui::Label::Ptr labels[21]"

my app has 1000 frames(FPS) more. (3500fps vs 2500fps).

So, what i say is that sf::Text is faster than tgui::Label.

is it clear now.

thanks



#174
General Discussion / Re: Label performance
25 September 2015, 12:11:23
When i say this example, i mean my code example (just 6 edit boxes and 21 label texts).

I did not make a question yes - it is more pointing out this situation.
Have you ever noticed that frame delay?
Seem right for me to tell about my detection findings.

thanks
billarhos
#175
General Discussion / Label performance
25 September 2015, 11:01:14
Hi

I realize that if i use sf::Text instead of tgui::Label::Ptr, i gain more frame performance.
For example in release mode and 21 Texts painting out, i gain about 1000 frames. I use no frame limit.
In this example  i used DejaVuSans.ttf , regular style and 15 for font size.

both result appearance are the same.

Thanks
billarhos