Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Protected Attributes | Friends
qt_input_text_widget_rep Class Reference

#include <qt_basic_widgets.hpp>

Inheritance diagram for qt_input_text_widget_rep:
Inheritance graph
[legend]
Collaboration diagram for qt_input_text_widget_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 qt_input_text_widget_rep (command _cmd, string _type, array< string > _def, int _style, string _width)
 ~qt_input_text_widget_rep ()
QAction * as_qaction ()
QLayoutItem * as_qlayoutitem ()
 Returns a QLayoutItem...
QWidget * as_qwidget ()
 Returns the actual QWidget wrapped by this qt_widget_rep.
virtual widget plain_window_widget (string s, command q)
 Returns the widget as window.
virtual widget make_popup_widget ()
virtual widget popup_window_widget (string s)
virtual QMenu * get_qmenu ()
 This method must not give ownership of the menu to the caller, thus allowing menu caching at the TeXmacs level.
virtual QWidget * get_canvas ()
 Get a texmacs canvas (if available).
virtual tm_ostreamprint (tm_ostream &out)
virtual void send (slot s, blackbox val)
virtual blackbox query (slot s, int type_id)
virtual widget read (slot s, blackbox index)
virtual void write (slot s, blackbox index, widget w)
virtual void notify (slot s, blackbox new_val)
virtual void connect (slot s, widget w2, slot s2)
virtual void deconnect (slot s, widget w2, slot s2)

Public Attributes

command cmd
string type
array< stringdef
string text
int style
string width
QTMInputTextWidgetHelperhelper
bool ok
int ref_count

Protected Attributes

list< widget_connectionin
list< widget_connectionout

Friends

class widget

Detailed Description

Definition at line 18 of file qt_basic_widgets.hpp.


Constructor & Destructor Documentation

qt_input_text_widget_rep::qt_input_text_widget_rep ( command  _cmd,
string  _type,
array< string _def,
int  _style,
string  _width 
)

Definition at line 496 of file qt_dialogues.cpp.

: cmd (_cmd), type (_type), def (_def), text (""), style(_style), width(_width),
  helper(NULL), ok(false) 
{
  if (N(def) > 0) {
    text = def[0];
  }
}

Here is the call graph for this function:

Definition at line 506 of file qt_dialogues.cpp.

                                                    { 
}

Member Function Documentation

QAction * qt_input_text_widget_rep::as_qaction ( ) [virtual]

Reimplemented from qt_widget_rep.

Definition at line 440 of file qt_dialogues.cpp.

                                      {
  QTMWidgetAction *a = new QTMWidgetAction (this);
  return a;
}
QLayoutItem * qt_input_text_widget_rep::as_qlayoutitem ( ) [virtual]

Returns a QLayoutItem...

Reimplemented from qt_widget_rep.

Definition at line 490 of file qt_dialogues.cpp.

                                          {
  return new QWidgetItem (as_qwidget ());
}

Here is the call graph for this function:

QWidget * qt_input_text_widget_rep::as_qwidget ( ) [virtual]

Returns the actual QWidget wrapped by this qt_widget_rep.

This is used to connect to signals, to change properties of the QWidget, etc.

Reimplemented from qt_widget_rep.

Definition at line 446 of file qt_dialogues.cpp.

                                      {
  if (!helper) {
    helper = new QTMInputTextWidgetHelper(this);
    // helper retains the current widget
    // in toolbars the widget is not referenced directly in texmacs code
    // so must be retained by Qt objects
  }
  QLineEdit *le;
  // FIXME: how is this check necessary (out of memory check seems unlikely...)
  if (helper) {
    le = new QTMLineEdit (NULL, helper->wid()->width);
    helper -> add (le);
    QObject::connect(le, SIGNAL(returnPressed ()), helper, SLOT(commit ()));
    QObject::connect(le, SIGNAL(editingFinished ()), helper, SLOT(leave ()));
    le -> setText (to_qstring (helper->wid()->text));
    
    le -> setStyleSheet (to_qstylesheet (style));
    le -> setMinimumSize(qt_decode_length(width, le));
    
    if (ends (type, "file") || type == "directory") {
      // autocompletion
      QCompleter *completer = new QCompleter(le);
      QDirModel *dirModel = new QDirModel(le);
      completer->setModel(dirModel);
      le->setCompleter(completer);
    } else if (N(def) > 0) {
      QStringList items;
      for (int j=0; j < N(def); j++) {
        items << to_qstring(def[j]);
      }
      QCompleter *completer = new QCompleter(items, le);
      completer->setCaseSensitivity(Qt::CaseSensitive);
      completer->setCompletionMode(QCompleter::InlineCompletion);
      le->setCompleter(completer);
    }
    
  } else {
    le = new QLineEdit(NULL);
  }
  return le;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void widget_rep::connect ( slot  s,
widget  w2,
slot  s2 
) [virtual, inherited]

Definition at line 150 of file widget.cpp.

                                               {
  widget_connection con (this, s, w2.rep, s2);
  insert (out, con);
  insert (w2->in, con);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void widget_rep::deconnect ( slot  s,
widget  w2,
slot  s2 
) [virtual, inherited]

Definition at line 157 of file widget.cpp.

                                                 {
  widget_connection con (this, s, w2.rep, s2);
  remove (out, con);
  remove (w2->in, con);
}
virtual QWidget* qt_widget_rep::get_canvas ( ) [inline, virtual, inherited]

Get a texmacs canvas (if available).

Reimplemented in simple_widget_rep.

Definition at line 80 of file qt_widget.hpp.

{ return NULL; }
virtual QMenu* qt_widget_rep::get_qmenu ( ) [inline, virtual, inherited]

This method must not give ownership of the menu to the caller, thus allowing menu caching at the TeXmacs level.

Called only by code which attaches root menus in the GUI elements.

Reimplemented in qt_ui_element_rep, and qt_menu_rep.

Definition at line 74 of file qt_widget.hpp.

{ return NULL; }
widget qt_widget_rep::make_popup_widget ( ) [virtual, inherited]

Reimplemented in qt_ui_element_rep, and qt_menu_rep.

Definition at line 34 of file qt_widget.cpp.

                                  {
  return this;
}
void widget_rep::notify ( slot  s,
blackbox  new_val 
) [virtual, inherited]

Reimplemented in aqua_input_widget_rep, aqua_chooser_widget_rep, qt_window_widget_rep, aqua_view_widget_rep, aqua_chooser_widget_rep, qt_input_widget_rep, qt_chooser_widget_rep, simple_widget_rep, simple_widget_rep, qt_view_widget_rep, wk_widget_rep, and qt_window_widget_rep.

Definition at line 194 of file widget.cpp.

                                            {
  list<widget_connection> l= out;
  while (!is_nil (l)) {
    l->item->w2->send (s, new_val);
    l= l->next;
  }  
}

Here is the call graph for this function:

widget qt_widget_rep::plain_window_widget ( string  s,
command  q 
) [virtual, inherited]

Returns the widget as window.

Each TeXmacs widget can at some point be asked to present itself into a window. The scheme-originating function window_create() expects this method in every widget. Widgets which are windows must declare themselves to be via the QProperty "texmacs_window_widget". This will be checked when processing messages from scheme asking to actually display the window. See qt_view_widget_rep::read() and qt_window_widget_rep::qt_window_widget_rep().

Parameters:
s(Often?) a title for the window.
q
Returns:
A pointer to this widget.

Reimplemented in qt_tm_widget_rep, qt_ui_element_rep, qt_input_widget_rep, qt_chooser_widget_rep, qt_printer_widget_rep, qt_view_widget_rep, qt_color_picker_widget_rep, and qt_menu_rep.

Definition at line 28 of file qt_widget.cpp.

                                                      {
  (void) s;
  return widget ();
}
widget qt_widget_rep::popup_window_widget ( string  s) [virtual, inherited]

Reimplemented in qt_ui_element_rep, and qt_menu_rep.

Definition at line 39 of file qt_widget.cpp.

                                            {
  (void) s;
  return widget ();
}
tm_ostream & widget_rep::print ( tm_ostream out) [virtual, inherited]

Reimplemented in wk_widget_rep.

Definition at line 207 of file widget.cpp.

                                  {
  return out << "widget";
}
blackbox widget_rep::query ( slot  s,
int  type_id 
) [virtual, inherited]
widget widget_rep::read ( slot  s,
blackbox  index 
) [virtual, inherited]
void widget_rep::send ( slot  s,
blackbox  val 
) [virtual, inherited]
void widget_rep::write ( slot  s,
blackbox  index,
widget  w 
) [virtual, inherited]

Friends And Related Function Documentation

friend class widget [friend, inherited]

Definition at line 59 of file widget.hpp.


Member Data Documentation

Definition at line 20 of file qt_basic_widgets.hpp.

Definition at line 22 of file qt_basic_widgets.hpp.

Definition at line 27 of file qt_basic_widgets.hpp.

list<widget_connection> widget_rep::in [protected, inherited]

Definition at line 36 of file widget.hpp.

Definition at line 28 of file qt_basic_widgets.hpp.

list<widget_connection> widget_rep::out [protected, inherited]

Definition at line 37 of file widget.hpp.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.

Definition at line 24 of file qt_basic_widgets.hpp.

Definition at line 23 of file qt_basic_widgets.hpp.

Definition at line 21 of file qt_basic_widgets.hpp.

Definition at line 25 of file qt_basic_widgets.hpp.


The documentation for this class was generated from the following files: