Results 1 to 3 of 3

Thread: Dialog creating problems

  1. #1

    Dialog creating problems

    why does this code create button that cannot be clicked? whats wrong?

    Code:
    #define true 1
    #define false 0
    
    #define FontM             "Zeppelin32"
    // font = "TahomaB";
    
    class GuiBaseCtrl
    {
    	idc = -1;
    	colorText[] = {0,0,1,1};
    	colorBackground[] = {0,1,0,0.25};
    	colorBackgroundActive[] = {0.5,0.5,0.5,1};
    	colorBackgroundDisabled[] = { 1, 1, 1, 0.5 };
    	tooltip = "test tooltip";
    	font = FontM;
    	//type = 0;
    style = ST_LEFT;
    default = false;
    	
    sizeEx = 0.03;
    text="";
    
      colorDisabled[] = {0, 0, 0.7, 1};
      colorFocused[] = {0.2, 0.2, 1, 1};
      colorShadow[] = {0, 0, 0, 1};
      colorBorder[] = {0.25, 0.25, 0.25, 1};
      borderSize = 2;
      
    	offsetX = 0.003;
    	offsetY = 0.003;
    	offsetPressedX = 0.002;
    	offsetPressedY = 0.002;
    	
    
    };
    
    class RscButton: GuiBaseCtrl
    {
    type = CT_BUTTON;
    	style = ST_LEFT;
    	action = "hint 'close'; closeDialog 0;";
    	text = "Button";
    	
    
    	
    };
    
    class MainTestDialog
    {
    //idc=77777;
    idd=-1;
    
    
    	class controlsBackground 
    	{ 
    	
    	};
    	
    	class objects { 
    		// define controls here
    	};
    	
    	
    class controls 
    {
    
    class RscButton_1600: RscButton
    {
    	idc = 1600;
    	x = 0.531923 * safezoneW + safezoneX;
    	y = 0.760254 * safezoneH + safezoneY;
    	w = 0.140149 * safezoneW;
    	h = 0.0521006 * safezoneH;
    };
    };
    };
    should get hint 'close'; when I click it but nothing happens.

    thx...

  2. #2
    ST_LEFT isn't defined, as well as CT_BUTTON
    add
    Code:
    #define ST_LEFT           0x00
    #define CT_BUTTON           1
    Also, its not really a problem, but you shouldn't have 'class RscButton: GuiBaseCtrl' because RscButton is a base class. If this code was used outside of the description.ext, it would wreck the default button code as well as put 'updating base class' errors in the rpt. You should just use a new class like RscButton_Custom
    Last edited by Sakura_Chan; Dec 31 2011 at 22:15.

  3. #3
    Cool thx!

    didnt know you have to define everything your self.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •