Options and pictures

Started by caddman6425 · 2012-08-24 17:13 UTC · 2 replies · SMF topic #1879

Hi all,
Don't even know where to begine with this one.  Let me see if I can explain.  I've got a picture box that I want to change pictures by the choice of two different option list.  Hmmmm, that sounds like a pretty good explanation to me, great  Also, one of the option list has a scroll bar in it and when I test it now, the text gets jumbled up when I play with it.  OK, maybe that's too much explaining, lets show pictures.

Oh, I guess I'd better ask what I need, OK, How do I do it? 
I know how to get the Member style to work,

;;;                                      Members                                                          ;;;
(defun c:MemStyleQty_OnSelChanged (ItemIndexOrCount Value /)
(setq mbrs ItemIndexOrCount)
(princ)
); end defun

Then I use a cond statment like the following:

    ((= mbrs 2)
    (progn
    (command
    "-MemberStyle" "_New" memstyna "_Component"
  "_Edit" "1" "_Name" "Section" "STart"
  "_SHape" memshna "" "_ENd" "_SHape"
  memshna "" "" "_Add" "_Edit"
  "2" "_Name" "Section" "_Start" "_SHape"
  memshna  "_Offset" "" custWidth ""
  "" "_ENd" "_SHape" memshna "_Offset"
  "" "" "" "" "" "" "" "" ""
    ); End command
    ); End progn   
    ); End predicate2

So I was thinking, would I do, or add to the cond for the other options?
Attachments
author=caddman6425 link=topic=1879.msg9224#msg9224 date=1345828423 wrote:the text gets jumbled up when I play with it.
This is related to the background color. Try changing it to -16.

author=caddman6425 link=topic=1879.msg9224#msg9224 date=1345828423 wrote:
So I was thinking, would I do, or add to the cond for the other options?
A lot depends on the structure/logic of your program and the -MemberStyle command. The dialog now suggests that the user must pick from three option lists. But some combinations of options are not logical: double+steel+pine=nonsense.
Please note that the ItemIndexOrCount argument of the (c:MemStyleQty_OnSelChanged) function is zero-based. So mbrs will have a value in the 0-3 range and not the 1-4 range.

In theory something like this would work:
(cond
  ((and (= mbrs "Single") (= option "Lumber") (= Material "Pine"))
    ; Do something.
  )
  ((and (= mbrs "Single") (= option "Lumber") (= Material "Spruce"))
    ; Do something else.
  )
  ;; etc.
)

But it would result in a very long (cond) structure.
Oh, thanks so very much on the heads up on the 0 based option list.  And again thanks for the backgroud color thing and the slider problem.  BUT, most of all thanks on the heads up on the code help!!!! ;D