0

The IUP documentation specifies a GUI element called Separator.

However it’s missing from the Available Classes list that pops up when you click Add Child / Add Brother in the Layout Dialog (the IUP GUI layout editor).

Separator is missing from Available Classes in the Layout Dialog

Not only that, when you try to include Separator manually in a LED file (as SEPARATOR() inside VBOX() or HBOX()) and then load it in the Layout Dialog and show it (or “map” it), you get the following error message:

IupMap failed.

Subsequently, only the GUI elements that precede Separator are displayed. Why?

Part of the answer could be that “it shows a line between two menu items” (per documentation) whereas I have attempted to use it outside menu on dialog’s canvas (inside VBOX()). It can’t be a complete truth though because I have seen Separator being used outside menu in GetParam dialog (screenshot there). And even if it were, it still doesn’t explain why Separator is missing from Available Classes in the Layout Dialog.

4

2 回答 2

1

IupSeparator is for menus only. That list is displayed to insert a new element inside the dialog.

The separator in IupGetParam is a IupLabel with the SEPARATOR attribute.

于 2017-04-12T17:08:08.870 回答
0

In the meanwhile, I have found a functional replacement to Separator and it’s apparently Label with attribute SEPARATOR set to HORIZONTAL/VERTICAL/YES.

Example (LED):

FakeSeparatorDlg = DIALOG[TITLE = "IUP fake separator demo"](
  VBOX[MARGIN = 5x5,GAP = 5](
    LABEL[TITLE = "Label Text 1"](""),
    LABEL[SEPARATOR = HORIZONTAL](""),
    LABEL[TITLE = "Label Text 2"]("")
  )
)

IUP fake separator demo

Attribute EXPAND = HORIZONTALFREE will be added automatically.

Demo sample.c also includes an unexplained attribute NAME = SAMP_SEP.

The downside is lack of a visible title but I will simply use Frame instead of Label when I need that.

Further reading

于 2017-04-12T15:40:41.307 回答