Skip to content

Divider - add the ability to set the max possible panel size #82

@EpicNet

Description

@EpicNet

I use a compiled build "DCX v3.1-1221-g09ed2f10" in mIRC v7.79 on Windows 11 23H2 x64

I am having trouble setting the maximum allowed width/height value for the left/top panel.

For example, if I want the left/top panel to be able to expand only within 200 pixels, then I'll have to do a lot of calculations with $calc() to set the right/bottom panel to the correct max value. But firstly, it is very inconvenient and complicated, and secondly, it becomes completely impossible when the entire construction consists of many nested child controls that have CLA properties for automatic resizing, since in this case, every time the size of the dialog is changed, the sizes of each control are changed, and then the left/upper panel of the divider can be expanded more than the required 200 pixels.

Perhaps in the command xdid -l|-r parameter IDEAL should have been responsible for this, but it doesn't work at the moment. In that case, it would be logical to rename it to MAX so that when creating a divider with child controls, it would be possible to set the maximum allowable width/height of the panel when the positioning bar is moved, and if the value is set to 0, then this should disable the maximum size of the panel, indicating that the size will depend on the maximum value of the opposite panel.

And of course, it would be convenient to have a command to change the value on the fly. For example, can expand the number of parameters for the command xdid -v, where the second parameter is for the minimum size, and the third for the maximum. But when used, specifying these parameters should be optional, or any of the parameters can be set to -1 to keep the initially set size.

  • Example command syntax: xdid -l|-r [DNAME] [ID] [MIN] [MAX] [TAB] [CID] [CONTROL] [X] [Y] [W] [H] (OPTIONS)
  • Example command syntax: xdid -v [DNAME] [ID] [POS] [MIN] [MAX]
  • Example identifiers properties: $xdid(dialog, ID).[leftmin|leftmax] , $xdid(dialog, ID).[rightmin|rightmax]

I hope this idea can be implemented or you will find some other convenient solution :-)

Image


Example of simple code for testing:

alias divider_test { $iif($dialog(dt),dialog -x dt,dialog -m dt dt) }
dialog -l dt {
  title "Divider Test"
  icon $mircexe,21
  option pixels
  size 300 300 700 500
}
on *:DIALOG:dt:init:0:{
  dcx Mark $dname cb_dt
  xdialog -b $dname +mntyz | xdialog -g $dname +b $rgb(0,0,0)
  xdialog -c $dname 1 divider 0 0 $dialog($dname).cw $dialog($dname).ch notheme vertical
  xdid -Q $dname 1 $rgb(66,69,75) $rgb(255,0,0) $rgb(255,0,0) $rgb(90,26,26) | xdid -W $dname 1 3
  xdid -l $dname 1 20 0 $chr(9) 2 panel 0 0 200 0 notheme | xdid -C $dname 2 +b $rgb(40,46,43)
  xdid -r $dname 1 490 0 $chr(9) 3 panel 0 0 0 0 notheme | xdid -C $dname 3 +b $rgb(35,35,35)
  xdid -v $dname 1 130 | xdid -J $dname 2,3 +r arrow
  xdialog -l $dname root $chr(9) +pv 0 1 0 0
  xdialog -l $dname cell root $chr(9) +li 1 1 0 0
}
alias cb_dt { if ($2 == dragfinish && $3 == 1) { echo -s Width size: $4 } }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions