Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » BUGFIX: Prompt() Does not correct size buttons
BUGFIX: Prompt() Does not correct size buttons [message #4830] Wed, 23 August 2006 11:18 Go to next message
aroman is currently offline  aroman
Messages: 18
Registered: November 2005
Promising Member

When specifying my own button labels, Prompt() does not correctly size the buttons for long text. For example, try this:
#include <CtrlLib/CtrlLib.h>

GUI_APP_MAIN
{
  Prompt("See the text overflow?",Null,
         "The buttons aren't big enough",
         "This is the first button",
         "This is the second button",
         "This is the third button");
}


The patch is simply to test for the button sizes:
Index: CtrlLib/Prompt.cpp
===================================================================
--- CtrlLib/Prompt.cpp	(revision 32)
+++ CtrlLib/Prompt.cpp	(working copy)
@@ -23,6 +23,9 @@
 	qtfctrl.SetQTF(String("[G1 ") + qtf, GetRichTextStdScreenZoom());
 	int bcy = Ctrl::VertLayoutZoom(24);
 	int bcx = Ctrl::HorzLayoutZoom(72);
+	if (button1) bcx = max( 6*fcy + GetTextSize(button1,Draw::GetStdFont()).cx, bcx );
+	if (button2) bcx = max( 6*fcy + GetTextSize(button2,Draw::GetStdFont()).cx, bcx );
+	if (button3) bcx = max( 6*fcy + GetTextSize(button3,Draw::GetStdFont()).cx, bcx );
 	Size bsz = icon.GetStdSize();
 	if(cx == 0) {
 		cx = qtfctrl.GetWidth();
Re: BUGFIX: Prompt() Does not correct size buttons [message #4832 is a reply to message #4830] Wed, 23 August 2006 11:32 Go to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
Thanks, applied.

I have just changed 6*fcy to 2*fcy - that seems better... (maybe you have patched 605 version, Prompt has been changed later).

Mirek

[Updated on: Wed, 23 August 2006 11:34]

Report message to a moderator

Previous Topic: Logs
Next Topic: Deactivate and Focus problem
Goto Forum:
  


Current Time: Sun May 26 02:18:30 CEST 2024

Total time taken to generate the page: 0.00505 seconds