Jump to content
Developer Wiki and Function Reference Links ×

Image controls in modern dialogs


Recommended Posts

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);

Link to comment

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.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...