Jef! Posted January 29, 2014 Posted January 29, 2014 Hi everyone! I like making lisps so much I've decided to go deeper and try making dcl menus. I found many sites with neat tutorials. I noticed that few use ": text {}" while others use ": text_part {}" but couldn't find anywhere the difference (if any). I also made a simple dialog using both simultaneously [color=red]:[/color] [color=blue]text[/color][color=red]{[/color] [color=blue]label[/color] [color=red]=[/color] [color=magenta]"This is a Test Message"[/color][color=red];[/color] [color=blue]alignment[/color] [color=red]=[/color] [color=blue]centered[/color][color=red];[/color] [color=red] }[/color] [color=red]:[/color] [color=blue]text_part[/color][color=red]{[/color] [color=blue]label[/color] [color=red]=[/color] [color=magenta]"This is a Test Message"[/color][color=red];[/color] [color=blue]alignment[/color] [color=red]=[/color] [color=blue]centered[/color][color=red];[/color] [color=red]}[/color] and the output seemed exactly the same. Is there any difference? Quote
MSasu Posted January 30, 2014 Posted January 30, 2014 The difference is in the way the interpretor is alocating leading/tailing space for labels when dialog is shown; please test the below demo: TEST : dialog { : row { fixed_width = true; :[color=blue] text[/color] { key = "t11"; value = "ABCDEF"; width = 5; } : text { key = "t12"; value = "12345"; width = 4; } } : row { fixed_width = true; :[color=magenta] text_part[/color] { key = "t21"; value = "ABCDEF"; width = 5; } : text { key = "t22"; value = "12345"; width = 4; } } ok_only; } Quote
Jef! Posted January 30, 2014 Author Posted January 30, 2014 mmm.. so text_part has no leading space and tail.. so using 2 text_part one after another is like having 1 single text.. that's why its named text_part. Logic. Not very likely, but if someone didn't figure out why with MSasu's example, I'll illustrate with the 2 expressions below, both having the same width of 9 chars. text_part =>(:text_part{) text_only =>(:text{) Since a text has leading/tailing space i'll represent it with " text_only " while i'll represent text_part with "text_part". With Msasu's example this is why width change and the position shift slightly " text_only "" text_only " "text_part"" text_only " Here are the 4 possibilities with 4 rows: text_part/text_part text_part/text text/text_part text/text ...all visually looking different even if they contain the same text. "text_part""text_part" "text_part"" text_only " " text_only ""text_part" " text_only "" text_only " Thank you very much M.Sasu! 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.