wesleyaqua Posted April 2, 2014 Author Posted April 2, 2014 Here's your dcl compressed as per Snownut's suggestion: //------------------------------------------------------------------------------ // Dwg_Blks [Drawing Blocks] - View and select drawing blocks //------------------------------------------------------------------------------ imlst : image_button {color = graphics_background; width = 25.92; height= 7.97; aspect_ratio = 1; } txlst : text {label = ""; width = 25.92; fixed_width = true; alignment = centered; } Dwg_Blks : dialog { label = "User_Lib Block Selector"; key = "title"; initial_focus = "cancel"; spacer; : row { : column { : list_box { label ="Block Selector"; key = "blocknameslist"; height = 50; width = 25; multiple_select = false; fixed_width_font = true; allow_accept = true; } } : column { : row { : imlst { key = "sld1"; } : imlst { key = "sld2"; } : imlst { key = "sld3"; } : imlst { key = "sld4"; } : imlst { key = "sld5"; } } : row { : column {: txlst {key = "sld1text"; }} : column {: txlst {key = "sld2text"; }} : column {: txlst {key = "sld3text"; }} : column {: txlst {key = "sld4text"; }} : column {: txlst {key = "sld5text"; }} } : row { : imlst { key = "sld6"; } : imlst { key = "sld7"; } : imlst { key = "sld8"; } : imlst { key = "sld9"; } : imlst { key = "sld10"; } } : row { : column {: txlst {key = "sld6text"; }} : column {: txlst {key = "sld7text"; }} : column {: txlst {key = "sld8text"; }} : column {: txlst {key = "sld9text"; }} : column {: txlst {key = "sld10text"; }} } : row { : imlst { key = "sld11"; } : imlst { key = "sld12"; } : imlst { key = "sld13"; } : imlst { key = "sld14"; } : imlst { key = "sld15"; } } : row { : column {: txlst {key = "sld11text"; }} : column {: txlst {key = "sld12text"; }} : column {: txlst {key = "sld13text"; }} : column {: txlst {key = "sld14text"; }} : column {: txlst {key = "sld15text"; }} } : row { : imlst { key = "sld16"; } : imlst { key = "sld17"; } : imlst { key = "sld18"; } : imlst { key = "sld19"; } : imlst { key = "sld20"; } } : row { : column {: txlst {key = "sld16text"; }} : column {: txlst {key = "sld17text"; }} : column {: txlst {key = "sld18text"; }} : column {: txlst {key = "sld19text"; }} : column {: txlst {key = "sld20text"; }} } } } : row { : column { : button { key = "previous"; label = "< Previous"; mnemonic = "P"; width = 70; fixed_width = true; alignment = centered; } : ok_button { mnemonic = "O"; alignment = right; width = 11; } } : column { : button { key = "next"; label = "Next >"; mnemonic = "N"; width = 70; fixed_width = true; alignment = centered; } : cancel_button { mnemonic = "C"; alignment = left; width = 11; } } } }//Dwg_Blks i've replaced it in my dcl (it didn't get worse but still got an error at the listbox Quote
wesleyaqua Posted April 2, 2014 Author Posted April 2, 2014 hi this is a wetransfer with the files lsp,dcl part of the library a cuix if someone wants to see how it works at the moment http://we.tl/ihoMIdjhyF thx already Quote
wesleyaqua Posted April 2, 2014 Author Posted April 2, 2014 it looks like my photo i posted first the looks are almost good except the font of the listbox looks weird/ugly. but the interaction at the background doesnt work. if i try to select the list box i got the bad argument error if i select the image it doesn't select/ highlight the listbox line equal to it. but if i click okay i can insert the item and that works almost fine it doesn't show the block before you pick an insert point. but that maybe normal cause of the explode and not explode. if you insert a block with explode you also don't see the block but i don't explode the block but he looks at it if he needs to explode it. (try and you maybe understand me better ) Quote
ymg3 Posted April 2, 2014 Posted April 2, 2014 Wesleyaqua, I did not change anything to the listbox, so I believe it should work as before. Clicking on the image will not do anything until we add the action_tile. I`ve dl the library and will set it up, then we can talk the same language. ymg Quote
ymg3 Posted April 2, 2014 Posted April 2, 2014 (edited) wesleyaqua, Something does not add up in this line: (action_tile "blocknameslist" "(mode_tile (nth (atoi (get_tile \"blocknameslist\")) 1) 2)") Probably needs something like: (action_tile "blocknameslist" "(mode_tile (nth (atoi (get_tile \"blocknameslist\")) blklst@) 2)") But I still do not understand why you would need to change the mode_tile to overwrite. One thing is sure the consp error comes from there. ymg Edited April 2, 2014 by ymg3 Quote
ymg3 Posted April 2, 2014 Posted April 2, 2014 Try this for your action_tile: (action_tile (strcat "sld" (itoa Rep#)) "(setq idx (+ (- (atoi (vl-string-subst \"\" \"sld\" $key)) 1) (* Pg_No# 20))) (set_tile \"blocknameslist\" (itoa idx)) (setq SlideRef$ $key Pick t)") As for the line in post #26 rem it out by adding a semi-comma in front. Another bizarre line here: (set_tile "blocknameslist" (strcat " " Libtitle$ " library "));;;;?????????? Either rem it out or set it to "1" ymg Quote
wesleyaqua Posted April 2, 2014 Author Posted April 2, 2014 (edited) Try this for your action_tile: (action_tile (strcat "sld" (itoa Rep#)) "(setq idx (+ (- (atoi (vl-string-subst \"\" \"sld\" $key)) 1) (* Pg_No# 20))) (set_tile \"blocknameslist\" (itoa idx)) (setq SlideRef$ $key Pick t)") As for the line in post #26 rem it out by adding a semi-comma in front. Another bizarre line here: (set_tile "blocknameslist" (strcat " " Libtitle$ " library "));;;;?????????? Either rem it out or set it to "1" ymg hi Well i followed tharwat his example but that didn't work so i think maybe i need to set_tile also I'll try it now and see if it works. could you also explain it in English the parts of the code so i understand how the parts interact with each other. i don't get an error now but it doesn't work.if i never selected an image i dont get notting. also when i select a image it doesn't highlight it. is that normal i removed the (action_tile "blocknameslist" "(mode_tile (nth (atoi (get_tile \"blocknameslist\")) blklst@) 2)") and only ed your last code. also i need to check if it still loads the block in the good way here at home i made a quick library and didn't check the setting for the insert of the scale i'll check that tomorow. Edited April 2, 2014 by wesleyaqua i tried it Quote
ymg3 Posted April 2, 2014 Posted April 2, 2014 wesleyaqua, Note that the line we rem'd out from post 26 will be required, I am working on it at the moment. Give me an hour or so ymg Quote
wesleyaqua Posted April 2, 2014 Author Posted April 2, 2014 wesleyaqua, Note that the line we rem'd out from post 26 will be required, I am working on it at the moment. Give me an hour or so ymg i updated my previous. damm i'm a fool is was searching for post 26 but al the post of yours were 226 i looked at the wrong side Quote
ymg3 Posted April 2, 2014 Posted April 2, 2014 wesleyaqua, try this for action-tile: (action_tile "blocknameslist" "(setq idx (+ (atoi $value) 1)) (setq SlideRef$ (strcat \"sld\" (itoa idx)) Pick t) (mode_tile (strcat \"sld\" (itoa idx)) 2)") ;;;;;modified Note that the mode_tile won't do nothing when you pick at a higher position than 20 in the list Also much complication could have been saved if you had name the tile starting at index 0 like the list. ymg Quote
wesleyaqua Posted April 2, 2014 Author Posted April 2, 2014 wesleyaqua, try this for action-tile: (action_tile "blocknameslist" "(setq idx (+ (atoi $value) 1)) (setq SlideRef$ (strcat \"sld\" (itoa idx)) Pick t) (mode_tile (strcat \"sld\" (itoa idx)) 2)") ;;;;;modified Note that the mode_tile won't do nothing when you pick at a higher position than 20 in the list Also much complication could have been saved if you had name the tile starting at index 0 like the list. ymg ymg thank alot its starting to look like what i'm trying. well for the mode_tile the problem is i think that the sld20 key is max that is used ? and the list is like 1 line=1 ,..,80 line =80 is it like this it works? couldn't that be solved when like if next is pressed to add like 20 or something. also i doesn't work the other way i noticed it doesn't highlight the listbox when selecting the image ? could that be solved with making an action_tile also but inverse ? well i'm not the original maker of the lsp teddycad made it i'm just trying to add the listbox to it but cant complain how he made it cause its easy to update the library's. but i cant follow with the index starting 0 i'm novice butt this is for me like expert writing the basic i understand a litle but this is a bit mutch to take in at the moment already thx i'm off to bed now. already past midnight here and need to get up early again tomorow Quote
ymg3 Posted April 2, 2014 Posted April 2, 2014 (edited) wesleyaqua, It does highlight the slide. This is what (mode_tile (strcat \"sld\" (itoa idx)) 2)") does. If you click on the image the list is highlighted as well, so it works both ways. However as told when you choose something that is in another page of slide nothing gets highlighted. It is probably too late to rename the tiles as you would need to go through the whole program and modify. This dialog gets re-used in many functions. But had the "sld#" been named "0" to "19" we would not have needed to compute anything to get a reference. Glad! I could help some and build a little on Tharwat's and Snownut's suggestions. ymg Edited April 3, 2014 by ymg3 Quote
Snownut Posted April 2, 2014 Posted April 2, 2014 ymg3 Just a thought would it be possible to place "" at the beginning of the list so essentially the 1st item in the list is at position 1. (I do this frequently) Quote
ymg3 Posted April 3, 2014 Posted April 3, 2014 Snownut, Probably, but as said this dcl is being re-used all over the place. And now, I got it working so ain't much incentives. I did use your trick to shortened the dcl, works great. I don't do a lot of dcl so I am very rusty. ymg Quote
wesleyaqua Posted April 3, 2014 Author Posted April 3, 2014 Snownut, Probably, but as said this dcl is being re-used all over the place. And now, I got it working so ain't much incentives. I did use your trick to shortened the dcl, works great. I don't do a lot of dcl so I am very rusty. ymg Ymg is their a possibilitie to add an extra dlc that doesn't involve other programs parts? like now it calls the dwg_blks aint i possible to just copy and past it as the dwg_blks1(dialog and change the lsp to call tis part up? or that i create anoter dlc where only this part works and i switch them by hand when i need to add a library don't have a problem with that also. then we only need to change that part //------------------------------------------------------------------------------ // Dwg_Blks1 [Drawing Blocks] - View and select drawing blocks //------------------------------------------------------------------------------ imlst : image_button {color = graphics_background; width = 25.92; height= 7.97; aspect_ratio = 1; } txlst : text {label = ""; width = 25.92; fixed_width = true; alignment = centered; } Dwg_Blks1 : dialog { }//Dwg_Blks1 the highlight doens't work when clicking on the sld. Quote
Snownut Posted April 3, 2014 Posted April 3, 2014 Snownut, Probably, but as said this dcl is being re-used all over the place. And now, I got it working so ain't much incentives. I did use your trick to shortened the dcl, works great. I don't do a lot of dcl so I am very rusty. ymg No problem, just showing a method to get the nth place in the list to eliminate the "0" position in the list. Quote
ymg3 Posted April 3, 2014 Posted April 3, 2014 wesleyaqua, If we use (mode_tile 4) instead of (mode_tile 2) you would get a much better view of what is selected. (action_tile "blocknameslist" "(setq idx (+ (atoi $value) 1)) (if SlideRef$ (mode_tile SlideRef$ 4)) (setq SlideRef$ (strcat \"sld\" (itoa idx)) Pick t) (mode_tile SlideRef$ 4)") ; (action_tile (strcat "sld" (itoa Rep#)) "(setq idx (+ (- (atoi (vl-string-subst \"\" \"sld\" $key)) 1) (* Pg_No# 20))) (if SlideRef$ (mode_tile SlideRef$ 4)) (mode_tile $key 4) (set_tile \"blocknameslist\" (itoa idx)) (setq SlideRef$ $key Pick t)") Mind you, it is still not completely OK as we will need to switch page when you go over 20. But you may try it like this and see if you like ymg Quote
wesleyaqua Posted April 3, 2014 Author Posted April 3, 2014 Mind you, it is still not completely OK as we will need to switch page when you go over 20. But you may try it like this and see if you like ymg Ymg hi just tested the actions. i like the mode_tile 4 more then the 2 indeed. but i found a bug maybe you are also aware of this. if i select by the list box the tile works perfect til 20 (what i know is normal til now) now if i let say stand on the listbox and selected the 2 one the 2 image wil go white. now if i select the 3 image it doesn't make the 3 image white nor the 2de one goes black. then if i go to the listbox and select back from there the 3de image goes white and the one i selected in list box (in case you did not now) also selecting an image doesn't highlight the listbox text. btw is there a good site where to learn some lisp like where the hell can i learn what mode_tile 2 and 4 wil look like and like is there also 1 and 3 en till what number goes it and stuff. but it after all it looks very promising Quote
ymg3 Posted April 3, 2014 Posted April 3, 2014 wesleyaqua, I know about the bug, hence my not completely OK. What we need to do is to switch page when we select in the listbox. Not too difficult. We also need to set condition right at beginning of routine. Looking into it as we speak. Will revert to you. (action_tile "blocknameslist" "(setq idx (+ (atoi $value) 1)) (if SlideRef$ (mode_tile SlideRef$ 4)) (setq SlideRef$ (strcat \"sld\" (itoa idx)) Pick t) (mode_tile SlideRef$ 4)") (action_tile (strcat "sld" (itoa Rep#)) "(setq idx (+ (- (atoi (vl-string-subst \"\" \"sld\" $key)) 1) (* Pg_No# 20))) (if SlideRef$ (mode_tile SlideRef$ 4)) (mode_tile $key 4) (set_tile \"blocknameslist\" (itoa idx)) (setq SlideRef$ $key Pick t)") try this last one ymg Quote
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.