Jump to content
Sign in to follow this  
jasono

Dialog Button and WordWrap/Multiline

Recommended Posts

Hello all,

I'm creating a dialog which will have a few small buttons on it, which would have various text. These buttons are quite small so can only fit one word in per line.

The issue I'm having is that I cannot get the text within a button to adhere to two lines, it overflows the border.

By default, the style I have used is 2. I have tried using Style = 16 (ST_MULTI) and both leaving them as separate words, \n and <br> and neither put the text on 2 lines (the \n and <br> both display as text). From what I can read the examples of using style 16 are to work with static text (type 0) so not sure if it's possible to have multiple lines on a button type element of the dialog?

I can't see a button being limited to one line and I'm sure it is possible, I'm just severely overlooking it? Below is my hpp file. Works fine and fully functional apart from the issue with the line break. Result of below is TWO\nLINES as the button text.

	class RscButton;
class panel_buttondefine: RscButton
{
	idc = -1;
	text = "";
	x = 0.8245 * safezoneW + safezoneX;
	y = 0.39 * safezoneH + safezoneY;
	w = 0.0415 * safezoneW;
	h = 0.0485 * safezoneH;
	sizeEx = 0.02;
	action = "";
	type = 1;
	style = 16;
	lineSpacing = 0.5;
	font = "TahomaB";
	colorText[] = {0,0,0,1};
	colorBackground[] = {0,0,0,0};
	colorFocused[] = {0,0,0,0};
	colorBackgroundActive[] = {1,0,0,.4}; 
	colorDisabled[] = {0,0,0,0};
	colorBackgroundDisabled[] = {0,0,0,0};
	colorShadow[] = {0,0,0,0};
	offsetX = 0;
	offsetY = 0;
	offsetPressedX = 0;
	offsetPressedY = 0; 
	borderSize = 0;
	colorBorder[] = {}; 
	soundEnter[] = {};
	soundPush[] = {};
	soundClick[] = {};
	soundEscape[] = {};
	toolTip = "";
};

class jas_WhelenController
{
	idd = 30999;
	movingenable = false;

		class Controls
		{
			class panelbg: RscPicture
			{
				idc = 1200;
				text = "images\panel.paa";
				x = 0.8 * safezoneW + safezoneX;
				y = 0.35 * safezoneH + safezoneY;
				w = 0.40525 * safezoneW;
				h = 0.51212 * safezoneH;
			};
			class panel_button1: panel_buttondefine
			{
				idc = 9601;
				x = 0.8245 * safezoneW + safezoneX;
				y = 0.39 * safezoneH + safezoneY;
				sizeEx = 0.028;
				text = "360";
				action = "hint ""Button 1"";";
			};
			class panel_button2: panel_buttondefine
			{
				idc = 9602;
				x = 0.8745 * safezoneW + safezoneX;
				y = 0.39 * safezoneH + safezoneY;
				h = 0.2; w = 0.1;
				sizeEx = 0.019;
				text = "TWO\nLINES";
				action = "hint ""Button 2"";";
			};
		};
};  

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×