guitarguy1685 Posted March 25, 2010 Share Posted March 25, 2010 I'm wring a dialog box with some text. My problem is that when I view my dialog box I have this fairly large amount of space to the right of my text. I tried changing widths of the boxes but I can't get rif of that gap. If I make the widthes huge i see the change. if I try to make it small I will only go as small as my text is wide + that gap. Anyone have this problem? a second question This dialog box displays if a block is not found. The block name is set as a variable in the lisp. How can I get this to display in the dialog box? Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted March 25, 2010 Share Posted March 25, 2010 I'm wring a dialog box with some text. My problem is that when I view my dialog box I have this fairly large amount of space to the right of my text. I tried changing widths of the boxes but I can't get rif of that gap. If I make the widthes huge i see the change. if I try to make it small I will only go as small as my text is wide + that gap. Anyone have this problem? Just to give you an idea: : popup_list { key = "MYKEY"; // Set your key here. [color=red]width = 18.0; // Set your width here[/color] fixed_width = true; // Set it as fixed width alignment = centered; // Center the list } You can adjust the width larger or smaller by changing the value. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 25, 2010 Share Posted March 25, 2010 As Buzzard says, most like the fixed_width attribute. AfraLISP has a pretty good walkthrough for dialogs if you haven't seen it already. Quote Link to comment Share on other sites More sharing options...
guitarguy1685 Posted March 25, 2010 Author Share Posted March 25, 2010 heres i my code //DCL CODING STARTS HERE BLK_INS_ERROR : dialog { fixed_width = true; label = "©2009 test test"; : boxed_column { label = "BLOCK NOT FOUND"; alignment = centered; fixed_width = true; width = 15; value = 0; : paragraph { : text { label = "test test test test test testtest test test "; } : text { label = "test tes testtest test test test test test "; } } : paragraph { : text { label = "test test testtest test test test test test "; } : text { label = "test test testtest test test test test test "; } : text { label = "test test testtest test test test test test "; } } } : button { key = "accept"; label = "Cancel"; is_default = true; fixed_width = true; alignment = centered; is_cancel = true; is_tab_stop = true; } } the width is not working for me Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted March 25, 2010 Share Posted March 25, 2010 heres i my code //DCL CODING STARTS HERE BLK_INS_ERROR : dialog { fixed_width = true; label = "©2009 test test"; : boxed_column { label = "BLOCK NOT FOUND"; alignment = centered; fixed_width = true; width = 15; value = 0; : paragraph { : text { label = "test test test test test testtest test test "; } : text { label = "test tes testtest test test test test test "; } } : paragraph { : text { label = "test test testtest test test test test test "; } : text { label = "test test testtest test test test test test "; } : text { label = "test test testtest test test test test test "; } } } : button { key = "accept"; label = "Cancel"; is_default = true; fixed_width = true; alignment = centered; is_cancel = true; is_tab_stop = true; } } the width is not working for me You did not identify the type of tile and You are missing } at the end. [color=red]: popup_list {[/color] label = "BLOCK NOT FOUND"; alignment = centered; fixed_width = true; width = 15; value = 0; [color=red]} [/color] Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted March 25, 2010 Share Posted March 25, 2010 After looking over your dialog file, I am not sure what you are trying to do. Do you want a list or have the program report back to the dialog. I am not sure. Can you post your code with it so I can see whats going on? This dialog box displays if a block is not found. The block name is set as a variable in the lisp.How can I get this to display in the dialog box? Maybe an alert box would be better than a dialog box for what you are trying to do. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted March 25, 2010 Share Posted March 25, 2010 Seems to me all you really need is this: Display an alert box. (defun MISSING_BLOCK () (alert "BLOCK NOT FOUND!") (princ)) or this: Print to command line. (defun MISSING_BLOCK () (princ "BLOCK NOT FOUND!") (princ)) Quote Link to comment Share on other sites More sharing options...
guitarguy1685 Posted March 26, 2010 Author Share Posted March 26, 2010 Well I would do an alert if all I wanted was to show the error. This dialog box however will have some more information. and possibly show the full path of the block. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted March 26, 2010 Share Posted March 26, 2010 Well I would do an alert if all I wanted was to show the error. This dialog box however will have some more information. and possibly show the full path of the block. Ok Im with you, But can you post the lisp code as well? Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted March 26, 2010 Share Posted March 26, 2010 So you are expecting something like this: BLK_INS_ERROR : dialog { label = "©2009 test test"; : row { : column { : boxed_column { label = "BLOCK NOT FOUND"; : paragraph { : text { value = "test test test test test test test test test"; fixed_width = true; width = 30; } : text { value = "test test test test test test test test test"; fixed_width = true; width = 30; } } : paragraph { : text { value = "test test test test test test test test test"; fixed_width = true; width = 30; } : text { value = "test test test test test test test test test"; fixed_width = true; width = 30; } : text { value = "test test test test test test test test test"; fixed_width = true; width = 30; } } } } } : button { key = "accept"; label = "Cancel"; is_default = true; fixed_width = true; alignment = centered; is_cancel = true; is_tab_stop = true; } } Change label to value for the text. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted March 26, 2010 Share Posted March 26, 2010 Better yet I added a spacer instead. If you should need more or less room, Then adjust the value of the spacer width. BLK_INS_ERROR : dialog { label = "©2009 test test"; : row { : column { : boxed_column { label = "BLOCK NOT FOUND"; : paragraph { : text { value = "test test test test test test test test test"; } : text { value = "test test test test test test test test test"; } } : paragraph { : text { value = "test test test test test test test test test"; } : text { value = "test test test test test test test test test"; } : text { value = "test test test test test test test test test"; } [color=red] : spacer {[/color] [color=red] width = 30;[/color] [color=red] }[/color] } } } } : button { key = "accept"; label = "Cancel"; is_default = true; fixed_width = true; alignment = centered; is_cancel = true; is_tab_stop = true; } } Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted March 26, 2010 Share Posted March 26, 2010 With regard now to your second question: a second question This dialog box displays if a block is not found. The block name is set as a variable in the lisp. How can I get this to display in the dialog box? Below is a small program that calculates the amount of cables that can fit into a cable tray. It has an input section and output section that receives values from the lisp and displays them in the dialog. You can review this program to see how this is done. There are comments to help you understand what going on. This program was done several years ago when I was first learning how do do so more advanced stuff. It is not that great, However it has the essentials for what you need to know. How well you polish your lisp is entirely upto you, But I believe you will find your answers in it. NOTE: The basic operation of this program is to take a string value from the dialog, convert it to a real, then calculate it, return it back to a string as the dialog only accepts strings, then send it back to the dialog to another tile being a text type tile with a key. Since you are working with strings already, Please keep in mind that the string to real and real back to string will not be needed in your case. Your dialog file could look something like this depending on how you want to name your keys. BLK_INS_ERROR : dialog { label = "©2009 test test"; : row { : column { : boxed_column { label = "BLOCK NOT FOUND"; : paragraph { : text { key = "TEXT1"; } : text { key = "TEXT2"; } } : paragraph { : text { key = "TEXT3"; } : text { key = "TEXT4"; } : text { key = "TEXT5"; } : spacer { width = 30; } } } } } : button { key = "accept"; label = "Cancel"; is_default = true; fixed_width = true; alignment = centered; is_cancel = true; is_tab_stop = true; } } The blank area of the dialog should return your values that are stored in your variable. Take note that the width of the dialog is still set to the spacer value even though it is shown blank. Your variable value will be displayed in the given key or tile you assign to it. As an example for your lisp since I do not know your variable names: (defun BLOCK_NOT_FOUND () (set_tile "TEXT1" BLOCK1) (set_tile "TEXT2" BLOCK2) (set_tile "TEXT3" BLOCK3) (set_tile "TEXT4" BLOCK4) (set_tile "TEXT5" BLOCK5)) As I mentioned before, Please review the program and dialog files. You will start to understand. Good Luck, Any further questions, I will be happy to answer. The Buzzard CTF.zip Quote Link to comment Share on other sites More sharing options...
guitarguy1685 Posted March 26, 2010 Author Share Posted March 26, 2010 thanks so much for your help i really appreciate it. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted March 26, 2010 Share Posted March 26, 2010 Not a problem at all. Good Luck 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.