RobYost Posted November 12, 2017 Share Posted November 12, 2017 This is not a complaint I am very happy with UniGUI, BUT it seems there are many times I get on the support forum and ask how to do something and the answer is I have to do it in JavaScript. DelphiDeveloper goes to the trouble to answer the question for example: Hi, Can you try this approach for now ?!: UnimLabel1 -> ClientEvents -> UniEvents -> function afterCreate: function afterCreate(sender) { var me = sender; me.element.on("tap", function() { me.fireEvent("click"); } )} Best regards, But really wouldn't it have been easier for everyone if he just added this code to the constructor of UnimCustomLabel? I changed the constructor, and it works (just as a test, I know it will go away next release. constructor TUnimCustomLabel.Create(AOwner: TComponent); begin inherited; Width := 225; Height := 23; ClientEvents.UniEvents.Add ('afterCreate=function afterCreate(sender) '#13#10'{'#13#10' var me = sender;'#13#10' me.element.on("tap",'#13#10' function() {'#13#10' me.fireEvent("click");'#13#10' }'#13#10' )'#13#10'}'); end; This is just an example. The font properties are ignored on mLable. I added the code DelphiDeveloper supplied to the Update function and it also works. It just seems to me it would be just as easy to add this functionality than it would be to send me JS code to fix it, then you won't be asked that question again because I see people (including me) ask the same question again. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.