Jump to content

Scroll bar in boxed_column DCL


Trudy

Recommended Posts

Hello i want to ask if it possible to add scroll bar in boxed_column when size is bigger than fixed.

Something like this

image.png.900c3d040559201a784d55d1fc009a13.png 

and when i have more than 5-6 lines i want scroll bar not THIS

image.png.c08b51e290f03e4b89b9645eefc43f34.png

 

Trudy : dialog { label ="Test1"; spacer;
		
:boxed_column {	
	label = "TRY1";
	width = 30;
	height = 10;
		
  : row {
  
    : edit_box   { key = "cod"; 
				 label = "CODE" ;
				 width = 10;
				 fixed_width = true;
				}
				
    : popup_list   { key = "mod"; 
		color = 1;
				 label = "MODE"; 
				 width = 20;
				 fixed_width = true;
				 allow_accept = true;
				}
		}

  : row {
  
    : edit_box   { key = "cod1"; 
				 label = "CODE" ;
				 width = 10;
				 fixed_width = true;
				}
				
    : popup_list   { key = "mod1"; 
		color = 1;
				 label = "MODE"; 
				 width = 20;
				 fixed_width = true;
				 allow_accept = true;
				}
		}
  : row {
  
    : edit_box   { key = "cod2"; 
				 label = "CODE" ;
				 width = 10;
				 fixed_width = true;
				}
				
    : popup_list   { key = "mod2"; 
		color = 1;
				 label = "MODE"; 
				 width = 20;
				 fixed_width = true;
				 allow_accept = true;
				}
		}
  : row {
  
    : edit_box   { key = "cod3"; 
				 label = "CODE" ;
				 width = 10;
				 fixed_width = true;
				}
				
    : popup_list   { key = "mod3"; 
		color = 1;
				 label = "MODE"; 
				 width = 20;
				 fixed_width = true;
				 allow_accept = true;
				}
		}
  : row {
  
    : edit_box   { key = "cod4"; 
				 label = "CODE" ;
				 width = 10;
				 fixed_width = true;
				}
				
    : popup_list   { key = "mod4"; 
		color = 1;
				 label = "MODE"; 
				 width = 20;
				 fixed_width = true;
				 allow_accept = true;
				}
		}
  : row {
  
    : edit_box   { key = "cod5"; 
				 label = "CODE" ;
				 width = 10;
				 fixed_width = true;
				}
				
    : popup_list   { key = "mod5"; 
		color = 1;
				 label = "MODE"; 
				 width = 20;
				 fixed_width = true;
				 allow_accept = true;
				}
		}
  : row {
  
    : edit_box   { key = "cod6"; 
				 label = "CODE" ;
				 width = 10;
				 fixed_width = true;
				}
				
    : popup_list   { key = "mod6"; 
		color = 1;
				 label = "MODE"; 
				 width = 20;
				 fixed_width = true;
				 allow_accept = true;
				}
		}
  : row {
  
    : edit_box   { key = "cod7"; 
				 label = "CODE" ;
				 width = 10;
				 fixed_width = true;
				}
				
    : popup_list   { key = "mod7"; 
		color = 1;
				 label = "MODE"; 
				 width = 20;
				 fixed_width = true;
				 allow_accept = true;
				}
		}
  : row {
  
    : edit_box   { key = "cod8"; 
				 label = "CODE" ;
				 width = 10;
				 fixed_width = true;
				}
				
    : popup_list   { key = "mod8"; 
		color = 1;
				 label = "MODE"; 
				 width = 20;
				 fixed_width = true;
				 allow_accept = true;
				}
		}
  : row {
  
    : edit_box   { key = "cod9"; 
				 label = "CODE" ;
				 width = 10;
				 fixed_width = true;
				}
				
    : popup_list   { key = "mod9"; 
		color = 1;
				 label = "MODE"; 
				 width = 20;
				 fixed_width = true;
				 allow_accept = true;
				}
		}		
		}
		ok_cancel;
		}

Thank you :)

 

Link to comment
Share on other sites

You can't actually program the DCL code to have a panel that scrolls. However - you can "fake" the scrolling by using a slider and altering the values of the boxes to "scroll" them. It's allot of work though.

 

You have to do the following things:

1.) either have a dialog defined for each of 1 through 10 items, or define the dialog on the fly from within the lisp.

     (Alternatively - you could just use 1 dialog with 10 items and just use (mode_tile) to disable the slider and extra boxes.)

2.) If the list is over 10 items, use a predefined dialog with 10 items and a slider to the right of the column. Set the sliders "layout" attribute to "vertical".

3.) You have to set the "small_increment" attribute to 1, and the "big_increment" to 10 (or smaller) in the slider. 

4.) To have the slider start at the top, you have to set the value of the slider (via "set_tile" in the lisp function) to the length of the list i.e. (set_tile "scroll1" (length lst1)).

5.) when the slider is used, you have to reverse the $value returned by the slider like (- (length lst1) $value) in the action_tile statement.

6.) in the action_tile statement, you have to define a callback function that will reset all the values from the list elements to start with the list item from the slider value after above step.

7.) also in the callback, you have to check for the $reason callback 3 to show the values scrolling, but reset the values if the user does not make a final selection ($reason value of 3 is returned).

8.) you have to record the altered value of the slider from step 5 and add that number to offset the "nth" value when changing items in your list elements, so that the correct item is edited.

 

This is allot of code, but possible. I hope this helps.

 

EDIT:

Below is a DCL example I made with 10 rows and a slider. Let me know if you have questions.

Note:

1) I used "text" tiles instead of labels for the boxes, so they can be independently updated, and the width is consistent.

2) I used a "max_value" attribute on the slider tile of 1000. this should be set to the longest list you think your going to have. It is even better if you write the DCL from within the LISP file, then you can set the "max_value" attribute to the exact length of the list every time. This makes the scrolling hit bottom when the list ends. Unfortunately - this attribute cannot be set at run-time.

special_list1 : dialog {
   key = "sd1";
   label = "Special List 1";
   : row {
      : boxed_column {
         : row {
            : text {width = 10; key = "lbl1"; fixed_width = true; label = "Value 01";}
            : edit_box {width = 10; key = "edb1"; fixed_width = true;}
            : text {width = 10; key = "lbl1b"; fixed_width = true; label = "Option 01";}
            : popup_list {width = 12; key = "lst1"; fixed_width = true;}
         }
         : row {
            : text {width = 10; key = "lbl2"; fixed_width = true; label = "Value 02";}
            : edit_box {width = 10; key = "edb2"; fixed_width = true;}
            : text {width = 10; key = "lbl2b"; fixed_width = true; label = "Option 02";}
            : popup_list {width = 12; key = "lst2"; fixed_width = true;}
         }
         : row {
            : text {width = 10; key = "lbl3"; fixed_width = true; label = "Value 03";}
            : edit_box {width = 10; key = "edb3"; fixed_width = true;}
            : text {width = 10; key = "lbl3b"; fixed_width = true; label = "Option 03";}
            : popup_list {width = 12; key = "lst3"; fixed_width = true;}
         }
         : row {
            : text {width = 10; key = "lbl4"; fixed_width = true; label = "Value 04";}
            : edit_box {width = 10; key = "edb4"; fixed_width = true;}
            : text {width = 10; key = "lbl4b"; fixed_width = true; label = "Option 04";}
            : popup_list {width = 12; key = "lst4"; fixed_width = true;}
         }
         : row {
            : text {width = 10; key = "lbl5"; fixed_width = true; label = "Value 05";}
            : edit_box {width = 10; key = "edb5"; fixed_width = true;}
            : text {width = 10; key = "lbl5b"; fixed_width = true; label = "Option 05";}
            : popup_list {width = 12; key = "lst5"; fixed_width = true;}
         }
         : row {
            : text {width = 10; key = "lbl6"; fixed_width = true; label = "Value 06";}
            : edit_box {width = 10; key = "edb6"; fixed_width = true;}
            : text {width = 10; key = "lbl6b"; fixed_width = true; label = "Option 06";}
            : popup_list {width = 12; key = "lst6"; fixed_width = true;}
         }
         : row {
            : text {width = 10; key = "lbl7"; fixed_width = true; label = "Value 07";}
            : edit_box {width = 10; key = "edb7"; fixed_width = true;}
            : text {width = 10; key = "lbl7b"; fixed_width = true; label = "Option 07";}
            : popup_list {width = 12; key = "lst7"; fixed_width = true;}
         }
         : row {
            : text {width = 10; key = "lbl8"; fixed_width = true; label = "Value 08";}
            : edit_box {width = 10; key = "edb8"; fixed_width = true;}
            : text {width = 10; key = "lbl8b"; fixed_width = true; label = "Option 08";}
            : popup_list {width = 12; key = "lst8"; fixed_width = true;}
         }
         : row {
            : text {width = 10; key = "lbl9"; fixed_width = true; label = "Value 09";}
            : edit_box {width = 10; key = "edb9"; fixed_width = true;}
            : text {width = 10; key = "lbl9b"; fixed_width = true; label = "Option 09";}
            : popup_list {width = 12; key = "lst9"; fixed_width = true;}
         }
         : row {
            : text {width = 10; key = "lbl10"; fixed_width = true; label = "Value 10";}
            : edit_box {width = 10; key = "edb10"; fixed_width = true;}
            : text {width = 10; key = "lbl10b"; fixed_width = true; label = "Option 10";}
            : popup_list {width = 12; key = "lst10"; fixed_width = true;}
         }
      }
      : slider {key = "scroll1"; layout = vertical; small_increment = 1; big_increment = 10; value = 1000; max_value = 1000;}
   }
   ok_cancel;
}

 

Edited by pkenewell
  • Thanks 1
Link to comment
Share on other sites

Thanx for the lunch break Grrr... wish I had the time , its full moon and still working to get something finished for my colleagues tomorrow... even have no time to go witch hunting now boehoehoe 😄

 

Still I wonder , how are you gonna populate such a dialog , what kind of data would need such a construction. Seems a little academic?

 

Well, back to work , hope I'm finished bee-4 the sun rises  😵

  • Like 1
Link to comment
Share on other sites

My $0.05 lot of work if each list is different amounts like lst1 = 10 lst2 = 4 lst3 = 8  these dcl support enter value or slider the total is updated as drag or number entered a bit of a dummy not used in the code.

 

image.png.32473531c9d273d926df07aca5982119.png

 

I think this is more what you want size is changed as dragged so would somehow read a list and set_tile value

 

image.png.c16902b7c0beaf6bfb35d353af8a4d33.png

 

Link to comment
Share on other sites

Thank you all for the help i make it other way but i will save these files because i can Rebuild it.

Hello rlx the idea was to create repeat function like yours to create from list image.png.3eda5d9e9e04893833fd6f743a25f649.png but i dont think the lists will me more than 15-20 and i create it manualy. Im geodesyst and when we measure something we can use Codes and with the code and measure in order i can create autmaticly Polylines and here come MODE mode will be (reversed, closed and just pline). My lisp work for now but i think if i use dcl operator will have more control because now we shoud use only these codes where i write or every time i have to change the codes in lisp. Im not a programer its just my hobby and for that reason the things go slowly :D 

 

Hello pkenewell thanks for your answer i will try this things 100% :)

 

For now slider is complicated for me, some day i hope i will understand how it work :D 

Link to comment
Share on other sites

@Trudy , I think in your case it would be better to use a next & previous page button,  so when your data list has more than 10 rows , the next button is enabled else its not. More a kind of horizontal scroll so to speak. Do all your poppies have the same lists so mode would always be mode-1 -2-3- and layer always layers in your drawing , ditto for Ltype?

 

your list would be like (       ( code1 mode lay ltype) (code2 mode lay ltype) …. ) ?

Link to comment
Share on other sites

Hello rlx

Yea this will be perfect i will try 

And for the list only Code is different all other MODE will be only 3 type (but only 1 list)  Layer will be all layer in drawing and Ltype same as Layer.

CODE - (Road, Building, Fence ...) they are all different.

 

Thank you for help :)

Link to comment
Share on other sites

Another Idea is to have a List Box with all the values tabbed, then double-click to edit and display a nested dialog to edit the values. Attached is an example I use for a Parts List program I created a long time ago.

Screen Shot 11-13-20 at 10.18 AM.JPG

Screen Shot 11-13-20 at 10.20 AM.JPG

  • Like 1
Link to comment
Share on other sites

Good catch pkenewell , probably simpler to implement too. Done something simular in the past.... wow , 2015, has it been five years ago already... how time flies... don't even know how this program works anymore haha

 

LG.jpg.d27bb657ece3b626084972bc94212215.jpg

Edited by rlx
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

just to get you started.  I've updated it a little bit this weekend so buttons work now. What you do with the end result (trudys-list) is your party cause it don't know didly about 'geodesism' 🐉

 

 

Trudys-List.jpg.3917dc1c6b96d4d34949a3b9bffc685c.jpg

 

Trudy.lsp

Edited by rlx
updated the lisp file a little more so most buttons now do something
  • Like 1
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...