Jump to content

image tile refreshing


nila_joy

Recommended Posts

HI..

 

I filled some image tiles (A) with colors ( in a dialog box) , and connected it to action tile with color code .. means If I click in red image button, the value 2 will be saved as variable . Now one separate image tile (B) is placed in the dialog box.. which will show the latest selected color. Means if i click a image tile with red color, the B image tile will show the color red.

 

Now the problem is the B image tile is not refreshing instantly , manes if i select red , the B tile is not updating instantly, the effect is reflected when I open the dialog box next time.

 

so , is any option available which will refresh the dialog box in the middle of a program?

 

 

I don't know did I explained my problem clearly or not.. if u guys can't understand , I'll post my code here.

 

 

Thanks,

 

Subho

INdia

Link to comment
Share on other sites

You can change the color of the image tile at run-time; just call the FILL_IMAGE with the new color (the image must be activated with START_IMAGE before, and call END_IMAGE next).

May be useful to post your code here for debug.

Link to comment
Share on other sites

Use an expression to update image_tile 'B' in the action_tile statements for image_tiles 'A', e.g.:

 

[color=GREEN];; Image Tile Example  -  Lee Mac 2012[/color]

([color=BLUE]defun[/color] c:test ( [color=BLUE]/[/color] *error* col dcl des tmp )

   ([color=BLUE]defun[/color] *error* ( msg )
       ([color=BLUE]if[/color] ([color=BLUE]<[/color] 0 dcl)
           ([color=BLUE]setq[/color] dcl ([color=BLUE]unload_dialog[/color] dcl))
       )
       ([color=BLUE]if[/color] ([color=BLUE]findfile[/color] tmp)
           ([color=BLUE]vl-file-delete[/color] tmp)
       )
       ([color=BLUE]if[/color] ([color=BLUE]not[/color] ([color=BLUE]wcmatch[/color] ([color=BLUE]strcase[/color] msg) [color=MAROON]"*BREAK,*CANCEL*,*EXIT*"[/color]))
           ([color=BLUE]princ[/color] ([color=BLUE]strcat[/color] [color=MAROON]"\nError: "[/color] msg))
       )
       ([color=BLUE]princ[/color])
   )
   
   ([color=BLUE]if[/color]
       ([color=BLUE]and[/color]
           ([color=BLUE]setq[/color] tmp ([color=BLUE]vl-filename-mktemp[/color] [color=BLUE]nil[/color] [color=BLUE]nil[/color] [color=MAROON]".dcl"[/color]))
           ([color=BLUE]setq[/color] des ([color=BLUE]open[/color] tmp [color=MAROON]"w"[/color]))
           ([color=BLUE]foreach[/color] line
              '(
                   [color=MAROON]"img : image_button { width = 6; aspect_ratio = 1; fixed_width = true; fixed_height = true; }"[/color]
                   [color=MAROON]"col : dialog { label = \"Image Tile Example\"; spacer;"[/color]
                   [color=MAROON]"    : image { key = \"main\"; width = 24; aspect_ratio = 1; }"[/color]
                   [color=MAROON]"    : row"[/color]
                   [color=MAROON]"    {"[/color]
                   [color=MAROON]"        : img { key = \"i1\"; }"[/color]
                   [color=MAROON]"        : img { key = \"i2\"; }"[/color]
                   [color=MAROON]"        : img { key = \"i3\"; }"[/color]
                   [color=MAROON]"        : img { key = \"i4\"; }"[/color]
                   [color=MAROON]"    }"[/color]
                   [color=MAROON]"    ok_only;"[/color]
                   [color=MAROON]"}"[/color]
               )
               ([color=BLUE]write-line[/color] line des)
           )
           ([color=BLUE]not[/color] ([color=BLUE]setq[/color] des ([color=BLUE]close[/color] des)))
           ([color=BLUE]<[/color] 0 ([color=BLUE]setq[/color] dcl ([color=BLUE]load_dialog[/color] tmp)))
           ([color=BLUE]new_dialog[/color] [color=MAROON]"col"[/color] dcl)
       )
       ([color=BLUE]progn[/color]
           ([color=BLUE]setq[/color] col 0)
           ([color=BLUE]foreach[/color] key '([color=MAROON]"i1"[/color] [color=MAROON]"i2"[/color] [color=MAROON]"i3"[/color] [color=MAROON]"i4"[/color])
               (_fill_image key ([color=BLUE]setq[/color] col ([color=BLUE]1+[/color] col)))
               ([color=BLUE]action_tile[/color] key ([color=BLUE]strcat[/color] [color=MAROON]"(_fill_image \"main\" "[/color] ([color=BLUE]substr[/color] key 2) [color=MAROON]")"[/color])) 
           )
           ([color=BLUE]start_dialog[/color])
       )
       ([color=BLUE]princ[/color] [color=MAROON]"\nError Loading Dialog."[/color])
   )
   ([color=BLUE]if[/color] ([color=BLUE]<[/color] 0 dcl)
       ([color=BLUE]setq[/color] dcl ([color=BLUE]unload_dialog[/color] dcl))
   )
   ([color=BLUE]if[/color] ([color=BLUE]findfile[/color] tmp)
       ([color=BLUE]vl-file-delete[/color] tmp)
   )
   ([color=BLUE]princ[/color])
)

([color=BLUE]defun[/color] _fill_image ( key col )
   ([color=BLUE]start_image[/color] key)
   ([color=BLUE]fill_image[/color] 0 0 ([color=BLUE]dimx_tile[/color] key) ([color=BLUE]dimy_tile[/color] key) col)
   ([color=BLUE]end_image[/color])
)
([color=BLUE]princ[/color])

Link to comment
Share on other sites

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...