The Buzzard Posted October 17, 2009 Share Posted October 17, 2009 Buzzard, I've been playing with alignment attribute with little success. I try to use an incremental renaming scheme on a program or project for that reason. COMP10 was worse the than 6 on the machines I tried it on. Go figure..... -David I do not understand, Worse in what way? Its the same program as COMP6 only renamed to COMP10. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 17, 2009 Share Posted October 17, 2009 This will fix the alignment. You need to add a column. : row { : column { : image_button { key = "Image1"; alignment = centered ; width = 50 ; fixed_width = true ; fixed_height = true ; aspect_ratio = 0.685547 ; color = -2; } } } Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 17, 2009 Share Posted October 17, 2009 Ok David, I think this is what the problem is with the images. I am using the same local functions as you are in your programs. If your programs and mine are loaded at the same time one or the other is going to clash because we are using the same exact local functions. I saw this happen after I loaded my program after yours and the opposite happened after I loaded yours after mine. Its using the local functions of the last program loaded. I will rename my local functions. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 17, 2009 Share Posted October 17, 2009 Ok David, I think this is what the problem is with the images. I am using the same local functions as you are in your programs. If your programs and mine are loaded at the same time one or the other is going to clash because we are using the same exact local functions. I saw this happen after I loaded my program after yours and the opposite happened after I loaded yours after mine. Its using the local functions of the last program loaded. I will rename my local functions. My local functions are now renamed. That did it, It worked! COMP10.zip Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 17, 2009 Author Share Posted October 17, 2009 Adding the column worked. A bit inifeicent but hey it fixed the deal. COMP10 is still off on certain machines. image_x returns 333 - image_y = 303 I'll check Monday with ADESK NG and see if Owen or Tony can fill us in. -David PS I always start a new session when testing any lisp routines. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 17, 2009 Share Posted October 17, 2009 Sorry about that David, I should know better. See the attached thread. http://www.cadtutor.net/forum/showthread.php?t=39998 Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 17, 2009 Share Posted October 17, 2009 David, I fixed that problem in post 64. Make sure you are loading that program. Our functions were clashing with each other. I got the same problem as you with your program. When I renamed my local functions, It fixed the problem. The dcl you are showing is not the dcl I am using. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 17, 2009 Share Posted October 17, 2009 My dcl is smaller. And all my sessions were new sessions. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 17, 2009 Share Posted October 17, 2009 Adding the column worked. A bit inifeicent but hey it fixed the deal. COMP10 is still off on certain machines. image_x returns 333 - image_y = 303 I'll check Monday with ADESK NG and see if Owen or Tony can fill us in. -David PS I always start a new session when testing any lisp routines. How is using a column in inefficient. That is how it is done if you mix it with several columns below. Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 17, 2009 Author Share Posted October 17, 2009 Buzzard, Using the column isn't, using both seems to be. In this case the row call can be omitted 'cause the image is the only thing on the row. Then the centered alignment places the image in the center s-s of the column. Because it fills the entire row, it will always be centered t-b. -David Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 17, 2009 Share Posted October 17, 2009 Buzzard, Using the column isn't, using both seems to be. In this case the row call can be omitted 'cause the image is the only thing on the row. Then the centered alignment places the image in the center s-s of the column. Because it fills the entire row, it will always be centered t-b. -David Understood, So just remove the top row call. Got it. Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 17, 2009 Author Share Posted October 17, 2009 And I imagine AutoCAD is going 'duh dude' .... 'I can't start without a dialog box without a row' Did you understand the enable and disable tiles part of the program? -David Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 17, 2009 Share Posted October 17, 2009 And I imagine AutoCAD is going 'duh dude' .... 'I can't start without a dialog box without a row' Did you understand the enable and disable tiles part of the program? -David Originally your image in post 29 required a row. I only forgot to remove it. Since you have changed the layout, I was not exactly sure which direction you were going with this program. But I quote you after mentioning the image was off to the left. I've been playing with alignment attribute with little success. I only suggested using a column. I am only offering some help. I am not being critical of your program. Why would even suggest that I may not understand what you are using mode tile for. I never brought it up. I am sorry if you do not see that I am only trying to be helpful. Sorry Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 18, 2009 Author Share Posted October 18, 2009 Buzzard, No, you've been most helpful. It was me that did the dumb things. Thanks! -David Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 18, 2009 Author Share Posted October 18, 2009 Buzzard, Here is the post for the dimx_tile: Trying to understand how ACAD comes up with the values it returns with the dimx_tile and dimy-tile calls. So far I think: start_image reads the dcl file looking for image_button -> key ( "Image1" ) Finds width argment ( 100 ) Finds height ( * 100 0.5 ) using the aspect ratio And it then uses some formula to determine the number of pixels to diplay the image I always guessed that width argment was the width to display the specified number of characters in an edit box On the test machines I've used, I have results for image_x of 600,750,800,900 image_y aspect ratios works as I would expect it to 300,350,400,450 These machines are either 800x600 or 1024x768 XP & '98 using ACAD 12 13 14 & 2000. There seems to no real rhyme or reson as to the differences and the formula is a bit of a mystery. It must have to do with hardware / video settings on each machine Any insight would be apprciated greatly! DIMX.DCL dcl_settings : default_dcl_settings { audit_level = 0; } comp : dialog { label = "dimx_tile Testing"; : image_button { key = "Image1"; width = 100 ; fixed_width = true ; fixed_height = true ; aspect_ratio = 0.5 ; color = -2 ; } : row { ok_cancel ; } } DIMX.LSP (defun make_slide () (start_image "Image1") (setq image_x (dimx_tile "Image1") image_y (dimy_tile "Image1")) (fill_image 2 0 image_x image_y -2) (end_image)) (defun c:dimx (/ id action image_x image_y) (setq id (load_dialog "DIMX")) (new_dialog "comp" id) (make_slide) (action_tile "accept" "(done_dialog 1)") (action_tile "cancel" "(done_dialog 0)") (setq action (start_dialog)) (unload_dialog id) (prin1 (list image_x image_y)) (prin1)) The reason for this exersice is a problem centering an image in an image_button. TIA -David Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 18, 2009 Share Posted October 18, 2009 This is from Afralisp: (fill_image x1 y1 wid hgt color) Draws a filled rectangle in the currently active dialog box image tile The fill_image function must be used between start_image and end_image calls. The color parameter is an AutoCAD color number or one of the logical color numbers shown in the following table. Symbolic names for the color attribute Color number ADI mnemonic Description -2 BGLCOLOR Current background of the AutoCAD graphics screen -15 DBGLCOLOR Current dialog box background color -16 DFGLCOLOR Current dialog box foreground color (text) -18 LINELCOLOR Current dialog box line color The first (upper-left) corner of the rectangle is located at (x1,y1) and the second (lower-right) corner is located the relative distance (wid,hgt) from the first corner (wid and hgt must be positive values). The origin (0,0) is the upper-left corner of the image. You can obtain the coordinates of the lower-right corner by calling the dimension functions dimx_tile and dimy_tile. This sort of explains it using the MIMAGE2.lsp or using MSLIDE Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 18, 2009 Share Posted October 18, 2009 The thing I hate about MSLIDE is that adjusting your slide height and width is sort of having a blindfold on while walking a plank. When I use the MIMAGE2.lsp, I can set my desired dimx_tile & dimy_tile and see the results immediately in the sample dcl the program creates. I just use the dcl info from that file. With MSLIDE I would need to mess around with the dimensions to get it close. I would think that you would have to subtract equals parts from the 0,0 coord and image_x, image_y coord to get a balanced look if you use MSLIDE. As I have said, I do not use MSLIDE all that much anymore because of the hassle. I hope that the previous post will shed some light on this anyway. Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 18, 2009 Author Share Posted October 18, 2009 I hope that the previous post will shed some light on this anyway. Exactly! But what I'm thinking is that with dimx_tile returning different values for width 41.59 and vector_image using literal pixel values there is no guaranteed way of correct sizing. I'm guessing slide_iamge goes and looks at the slide file and gathers the pixel values and then adjusts ( scales ) the differences. I've found that MSLIDE uses the screensize values for it's output. A visible screen menu and / or scroll bars can screw that up on centering. Now back to cooking beef vegetable soup on a wet rainy day ! -David Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 18, 2009 Share Posted October 18, 2009 Exactly! But what I'm thinking is that with dimx_tile returning different values for width 41.59 and vector_image using literal pixel values there is no guaranteed way of correct sizing. I'm guessing slide_iamge goes and looks at the slide file and gathers the pixel values and then adjusts ( scales ) the differences. I've found that MSLIDE uses the screensize values for it's output. A visible screen menu and / or scroll bars can screw that up on centering. Now back to cooking beef vegetable soup on a wet rainy day ! -David I suppose, But I never gave this much thought since this is the first time for me as well to work with an image button that work in this fashion. You have moved very fast thru this so far. As Kramer from Seinfeld once said: "You must suffer for your soup". Seems like you have to suffer for your program as well. All things being equal I guess. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 18, 2009 Share Posted October 18, 2009 You know the odd thing about all this is when I used the program to make my slide and on the last go around I wanted a square tile smaller than the previous ones, So I set dimx_tile to 250 & dimy_tile also to 250. The results gave me a smaller square tile and I checked the pixel count as well as the center point and this all returned exactly as I displayed in post 76. If this changes on another machine, I really cannot explain why although I would think the video card and monitor size must play a role in this. I would also think that if you were to make the same settings on your machine, The same would hold true as well. Quote Link to comment Share on other sites More sharing options...
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.