1 #include <../../nrnconf.h> 2 #if HAVE_IV // to end of file 5 #include <IV-Win/MWlib.h> 8 #include <InterViews/style.h> 9 #include <InterViews/action.h> 11 #include <IV-Win/event.h> 12 #include <IV-Win/window.h> 15 #include <IV-Mac/event.h> 16 #include <IV-Mac/window.h> 18 #include <IV-X11/xevent.h> 19 #include <IV-X11/xwindow.h> 22 #include <InterViews/event.h> 23 #include <InterViews/handler.h> 24 #include <IV-look/kit.h> 25 #include <InterViews/background.h> 26 #include <InterViews/layout.h> 27 #include <InterViews/box.h> 28 #include <InterViews/session.h> 46 extern int iv_mere_dismiss;
50 extern void ivoc_dismiss_defer();
54 class DBAction :
public Action {
68 DBAction::~DBAction(){
101 if (win_) {win_->unmap();}
104 Session::instance()->quit();
122 win_defer_longer_ = win_;
127 win_defer_ = win_defer_longer_;
128 win_defer_longer_ =
NULL;
139 if (win_defer_ && win_defer_ != win_defer_longer_) {
176 Style* style = Session::instance()->style();
181 if ((style->find_attribute(
"dismiss_button", str) && str !=
"off")
185 style->find_attribute(
"pwm_dismiss_button", str);
189 menubar_ = WidgetKit::instance()->menubar();
197 if (style->find_attribute(
"use_transient_windows", str) && str ==
"yes") {
214 mi = WidgetKit::instance()->menubar_item(
215 LayoutKit::instance()->r_margin(
216 WidgetKit::instance()->fancy_label(name), 0.0,
fil, 0.0));
231 if (!style()->find_attribute(
"name", v)) {
232 v = Session::instance()->name();
238 static const char* s_;
239 static void setwindowtext(
void* v) {
241 SetWindowText(hw, s_);
247 HWND hw = Window::rep()->msWindow();
250 if (!nrn_is_gui_thread()) {
252 nrn_gui_exec(setwindowtext, hw);
256 SetWindowText(hw, s);
262 strncpy(&st[1], s, 254);
264 WindowPtr theWin = Window::rep()->macWindow();
266 SetWTitle(theWin, st);
270 style()->attribute(
"name", s);
276 style(
new Style(Session::instance()->style()));
277 style()->attribute(
"name", s);
293 TransientWindow::configure();
295 TopLevelWindow::configure();
300 TransientWindow::set_attributes();
302 TopLevelWindow::set_attributes();
312 intercept_->box_append(g);
331 if (leader_ ==
this) {
342 ((
Window*)
this)->rep()->request_on_resize_ = b;
349 style()->find_attribute(
"pwm_win_left_decor", decor);
353 return Coord(xleft());
361 style()->find_attribute(
"pwm_win_top_decor", decor);
363 return Window::bottom() + decor;
365 return Coord(xtop());
378 static EventTypeSpec myCollapseTypeSpec[] = {
379 {kEventClassWindow, kEventWindowClickCollapseRgn}
381 static OSStatus MyHandleCollapse(EventHandlerCallRef, EventRef,
void*);
382 static OSStatus MyHandleCollapse(EventHandlerCallRef, EventRef,
void* v) {
387 return eventNotHandledErr;
399 xmove(xleft_, xtop_);
404 EventHandlerUPP myHandleCollapse = NewEventHandlerUPP((EventHandlerProcPtr)MyHandleCollapse);
405 InstallWindowEventHandler(Window::rep()->macWindow(), myHandleCollapse, 1, myCollapseTypeSpec, (
void*)
this,
NULL);
437 void virtual_window_top();
438 bool iv_user_keydown(
long w) {
440 virtual_window_top();
446 if (e.rep()->messageOf() == WM_WINDOWPOSCHANGED) {
450 return DismissableWindow::receive(e);
461 DismissableWindow::receive(e);
462 if (e.type() == Event::other_event) {
463 XEvent& xe = e.rep()->xevent_;
465 case ConfigureNotify:
471 if (xtop() != xtop_ || xleft() != xleft_) {
473 xmove(xleft_, xtop_);
505 return type_.string();
565 session_priority_ = 1;
580 printf(
"OcGlyph::save (not implemented for relevant class)\n");
593 printf(
"%s %g %g\n", window()->
name(), window()->width(), window()->height());
599 w_->xplace((
int)left, (
int)top);
StandardWindow(Glyph *main, Glyph *info=NULL, Menu *m=NULL, Glyph *l=NULL, Glyph *r=NULL)
virtual bool has_window()
static void dismiss_defer()
virtual ~StandardWindow()
void request_on_resize(bool)
virtual PrintableWindow * make_window(Coord left=-1, Coord bottom=-1, Coord width=-1, Coord height=-1)
virtual ~DismissableWindow()
virtual bool event(Event &)
void append(PrintableWindow *)
static bool is_transient_
static void help(const char *)
const char * type() const
static DismissableWindow * win_defer_
DismissableWindow(Glyph *, bool force_menubar=false)
virtual Coord width_pw() const
virtual void no_parents()
virtual Glyph * glyph() const
virtual bool receive(const Event &)
PrintableWindow(OcGlyph *)
virtual const char * name() const
MenuItem * append_menubar(const char *)
const char * string() const
virtual void save(std::ostream &)
static double map(void *v)
virtual Coord height_pw() const
virtual PrintableWindow * window()
virtual Coord left_pw() const
static PrintableWindow * leader_
virtual void unref() const
static DismissableWindow * win_defer_longer_
virtual Coord save_bottom() const
void remove(PrintableWindow *)
static OcGlyphContainer * intercept_
static bool is_transient()
static double unmap(void *v)
OcGlyph(Glyph *body=NULL)
static PrintableWindowManager * current()
static PrintableWindow * leader()
virtual void set_attributes()
static OcGlyphContainer * intercept(OcGlyphContainer *)
virtual void replace_dismiss_action(WinDismiss *)
virtual Coord save_left() const
virtual ~PrintableWindow()
WinDismiss(DismissableWindow *)
virtual void def_size(Coord &w, Coord &h) const
virtual Glyph * print_glyph()
virtual Coord bottom_pw() const