Back to index

texmacs  1.0.7.15
Functions
basic_widget.cpp File Reference
#include "Widkit/basic_widget.hpp"
#include "gui.hpp"
#include "window.hpp"
#include "Widkit/Event/attribute_event.hpp"

Go to the source code of this file.

Functions

SI get_dx (gravity grav, SI w)
SI get_dy (gravity grav, SI h)
void test_round (wk_widget w, string var, SI num)
static void test_window_attached (event ev, wk_widget w)

Function Documentation

SI get_dx ( gravity  grav,
SI  w 
)

Definition at line 35 of file wk_widget.cpp.

                            {
  switch (grav) {
  case north_west: case west: case south_west:
    return 0;
  case north: case center: case south:
    return (w/(2*PIXEL))*PIXEL;
  case north_east: case east: case south_east:
    return w;
  }
  FAILED ("unknown gravity");
  return 0;
}

Here is the caller graph for this function:

SI get_dy ( gravity  grav,
SI  h 
)

Definition at line 49 of file wk_widget.cpp.

                            {
  switch (grav) {
  case north_west: case north: case  north_east:
    return 0;
  case west: case center: case east:
    return ((-h)/(2*PIXEL))*PIXEL;
  case south_west: case south: case south_east:
    return -h;
  }
  FAILED ("unknown gravity");
  return 0;
}

Here is the caller graph for this function:

void test_round ( wk_widget  w,
string  var,
SI  num 
)

Definition at line 244 of file basic_widget.cpp.

                                             {
  if (num != ((num>>8)<<8)) {
    w->wk_error ("Bad rounding of " * var * "=" * as_string (num));
    FAILED ("bad rounding");
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void test_window_attached ( event  ev,
wk_widget  w 
) [static]

Definition at line 252 of file basic_widget.cpp.

                                             {
  if (!w->attached ()) {
    cerr << "\n" << HRULE << "\n";
    cerr << ev << " was sent to\n" << w;
    cerr << HRULE << "\n";
    FAILED ("widget was not yet attached to window");
  }
}

Here is the caller graph for this function: