J. Miller Posted December 10, 2011 Share Posted December 10, 2011 Okay, I almost put a brick through the monitor. I have a PIO that utilizes a button to call a dialog that has a GetColorChoice Control in it. Through the mysteries of enabling and setting the VSO calls i got it to display and retrieve a color... BUT in the case statement that builds the pio i can either build the pio with the (3) case or pick the color with the (35) case. when i want to change the color of a handled object (outside of the case... is this wrong???) I either get the handle of the object or the color integer. I can't get both. What am i doing wrong?? I have been on many sites today to try to get a grip on vso things, but cant seem to find what the 'theevent' indexes are or could be. lost lost lost Sample.... BEGIN isObject := GetCustomObjectInfo(objectName, objectHan, recordHan, wallHan); vsoGetEventInfo(theEvent, theMessage ); CASE theEvent OF 3: BEGIN Build the PIO Stuff {hanFill is created in the pio stuff} END; 5: {kObjOnInitXProperties} BEGIN result := SetObjPropVS(8, TRUE); result := vsoInsertAllParams; result := vsoInsertWidget(2,12, 15, 'Change 2D Symbol Color', 0); END; 35: BEGIN ReturnColorDialog; {Custom Dialog to pick Color} AlrtDialog(Concat(' handle to Fill', hanFill, ' newColor ' , newColor)); {Returns color but not handle of hanFill} END; END; {of Case} AlrtDialog(Concat(' handle to Fill', hanFill, ' newColor ' , newColor)); {Returns HanFill but not Color} END; Quote Link to comment
C. Andrew Dunning Posted December 10, 2011 Share Posted December 10, 2011 Jeff - You might want to try...: - Create hidden OIP parameters to hold color info (a color index, 3 seperate RGB parameters, or a single parameter from which you parse RGB integers). - Build the PIO geometry based on those hidden color parameters. - When you OK out of the color-changing dialog, write the chosen color info to those hideen parameters. - Reset the PIO after exiting the dialog. This will cause the PIO to be regenerated using the new color. Make sense?? Quote Link to comment
J. Miller Posted December 10, 2011 Author Share Posted December 10, 2011 That did it. Once again I have to thank the gurus that read these posts and reply! If I only wrote code a little more frequently I might even be able to post answers myself. Thanks Andrew! (Now if I could only get those lost hours back) Jeff Miller Quote Link to comment
C. Andrew Dunning Posted December 10, 2011 Share Posted December 10, 2011 (Now if I could only get those lost hours back) Happy to help. Do you know how many times I've (and, I'm sure others on this forum) have said that? What should have been a 15-minute fix that turns into 8 hours...that turns into pleas from help from this community...that results in a kind soul graciously pointing out a simple handle naming error... Quote Link to comment
MaxStudio Posted January 27, 2012 Share Posted January 27, 2012 If I only wrote code a little more frequently I might even be able to post answers myself. I usually ask the question and if I make some progress on my own I post my progress and solution anyway. I figure it may help someone else out some day! Happy it all worked out for you! 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.