gc8 977 Posted December 31, 2011 why does this code create button that cannot be clicked? whats wrong? #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... Share this post Link to post Share on other sites
sakura_chan 9 Posted December 31, 2011 (edited) ST_LEFT isn't defined, as well as CT_BUTTON add #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 Edited December 31, 2011 by Sakura_Chan Share this post Link to post Share on other sites
gc8 977 Posted January 1, 2012 Cool thx! didnt know you have to define everything your self. Share this post Link to post Share on other sites