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 |
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();
|
|
|
|
Goto Forum:
Current Time: Sun May 26 02:18:30 CEST 2024
Total time taken to generate the page: 0.00505 seconds
|