Back to index

texmacs  1.0.7.15
Functions
aligned_widget.cpp File Reference
#include "renderer.hpp"
#include "Widkit/wk_widget.hpp"

Go to the source code of this file.

Functions

wk_widget aligned_widget (array< wk_widget > lhs, array< wk_widget > rhs, SI hsep, SI vsep, SI lpad, SI rpad)

Function Documentation

wk_widget aligned_widget ( array< wk_widget lhs,
array< wk_widget rhs,
SI  hsep,
SI  vsep,
SI  lpad,
SI  rpad 
)

Definition at line 16 of file aligned_widget.cpp.

{
  ASSERT (N(lhs) > 0, "at least one widget expected");
  ASSERT (N(lhs) == N(rhs), "sizes don't match");
  int i, n= N (lhs);
  SI max_w= 0;
  for (i=0; i<n; i++) {
    SI ww=1280*PIXEL, hh=64*PIXEL;
    lhs[i] << get_size (ww, hh, 0);
    max_w= max (ww, max_w);
  }

  array<wk_widget> fields_w (2*n-1);
  for (i=0; i<n; i++) {
    SI ww=1280*PIXEL, hh=64*PIXEL;
    lhs[i] << get_size (ww, hh, 0);
    array<wk_widget> line_w (5);
    array<string> line_n (5);
    line_w[0]= glue_wk_widget (false, false, lpad + max_w - ww);
    line_w[1]= lhs[i];
    line_n[1]= "prompt";
    line_w[2]= glue_wk_widget (false, false, hsep);
    line_w[3]= rhs[i];
    line_n[3]= "input";
    line_w[4]= glue_wk_widget (false, false, rpad);
    fields_w[2*i]= horizontal_list (line_w, line_n);
    if (i < n-1) fields_w[2*i + 1]= glue_wk_widget (false, false, 0, vsep);
  }

  return vertical_list (fields_w);
}

Here is the call graph for this function: