BillW Posted July 1, 2005 Share Posted July 1, 2005 I am trying to write a visual editor for rooflight placement. I was hoping to toggle the image associated with an image control (ie rooflight or standard sheet) but the clicking of an image control does not fire an event. The images are 50x75 pixels. NNA, is this by design or a bug and is it likely to be fixed? Alternatively am I doing something wrong. My test code is below. Thanks Bill Wood PC VW 11.01 PROCEDURE ImageTest; VAR gDlogID,gDlogResult : INTEGER; gOKdlog,rsAvailable : BOOLEAN; FUNCTION Define_Dialog: INTEGER; VAR dialogID,i : INTEGER; BEGIN dialogID := CreateLayout('Rooflight Editor',True,'OK','Cancel'); CreateStaticText(dialogID,4,'Set Rooflight:',-1); CreateControl(dialogID,5,1,'',1010); CreateControl(dialogID,6,1,'',1010); CreateControl(dialogID,7,1,'',1010); CreateControl(dialogID,8,1,'',1010); CreateControl(dialogID,9,1,'',1011); CreateControl(dialogID,10,1,'',1010); CreateControl(dialogID,11,1,'',1010); CreateControl(dialogID,12,1,'',1010); CreateControl(dialogID,13,1,'',1010); SetFirstLayoutItem(dialogID,4); SetBelowItem(dialogID,4,5,0,0); SetRightItem(dialogID,5,6,-2,0); SetRightItem(dialogID,6,7,-2,0); SetBelowItem(dialogID,5,8,0,-2); SetRightItem(dialogID,8,9,-2,0); SetRightItem(dialogID,9,10,-2,0); SetBelowItem(dialogID,8,11,0,-2); SetRightItem(dialogID,11,12,-2,0); SetRightItem(dialogID,12,13,-2,0); Define_Dialog := dialogID; END; PROCEDURE Drive_Dialog(VAR item:LONGINT; data:LONGINT); VAR temp_i,i:INTEGER; temp_s:STRING; result:BOOLEAN; BEGIN CASE item OF 5,6,7,8,9,10,11,12,13: alrtdialog('image hit'); END;{of CASE} END; BEGIN {MAIN} rsAvailable:= SetVSResourceFile('C:\Program Files\VectorWorks 11\images'); gDlogID := Define_Dialog; gOKdlog := VerifyLayout(gDlogID); IF gOKdlog THEN gDlogResult := RunLayoutDialog(gDlogID,Drive_Dialog); END; Run(ImageTest); Quote Link to comment
Rick Francken Posted July 7, 2005 Share Posted July 7, 2005 Bill, What is the value of rsAvailable right after you call SetVSResourceFile? Quote Link to comment
BillW Posted July 8, 2005 Author Share Posted July 8, 2005 Rick, rsAvailable is a BOOLEAN signifying if the resource file was successfully loaded. I have now changed my tack and use checkboxes to swap the content of image controls. However, it still would be nice to have an event on clicking an image control. PS the code framework was hacked from an NNA example. Quote Link to comment
Rick Francken Posted July 8, 2005 Share Posted July 8, 2005 Yes I know rsAvailable is a BOOLEAN. What is its value? True or False? Quote Link to comment
Rick Francken Posted July 8, 2005 Share Posted July 8, 2005 Bill, I just noticed a comment in one of the source code files in the VW SDK. It says that the Image control does not generate events. So it looks like that's by design. Unfortunately not what you wanted to hear... -Rick Quote Link to comment
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.
Note: Your post will require moderator approval before it will be visible.