Новости

Обновление исправляет совместимость с Freenode после обновления этой сетью версии IRCd.

Вышел второй релиз-кандидат KVIrc 4.0

Ричард Столлман дал автограф проекту и пожелал успеха в разработке.

Image:Feed.png RSS

Материал из IRC клиент KVIrc.

Перейти к: навигация, поиск

[править] Классы объектов

[править] widget

Base class for all widgets

Inherits object

Description This object class is the rappresentation of a widget. All the other widget-type classes inherit from this one.

Functions $show() Shows this widget and the children. See also $hide() and $isVisible.

$hide() Hides this widget (and conseguently all the children). See also $show() and $isVisible.

$repaint(<bool erase>) Repaints the widget directly by calling $paintEvent() immediately. If erase is TRUE, erases the widget before the $paintEvent() call.

$x() Returns the x coordinate of the upper-left corner of this widget relative to the parent widget, or to the desktop if this widget is a toplevel one.

$y() Returns the y coordinate of the uspper-left corner of this widget relative to the parent widget, or to the desktop if this widget is a toplevel one.

$width() Returns the width of this widget in pixels.

$height() Returns the height of this widget in pixels.

$geometry() Returns the widget geometry in this form: x, y, width, height.

$setGeometry(<x>,<y>,<width>,<heigth>) Sets the geometry of this widget. <x> and <y> are relative to the parent widget or to the desktop (if this widget is a toplevel one). All the parameters are in pixels.

$setMinimumWidth(<value>) Sets the minimum width of this widget to <value>. The user will not be able to resize the widget to a smaller value. This value is also used by the layout class.

$setMinimumHeight(<value>) Sets the minimum height of this widget to <value>. The user will not be able to resize the widget to a smaller value. This value is also used by the layout class.

$setMaximumWidth(<value>) Sets the maximum width of this widget to <value>. The user will not be able to resize the widget to a bigger value. This value is also used by the layout class.

$setMaximumHeight(<value>) Sets the maximum height of this widget to <value>. The user will not be able to resize the widget to a bigger value. This value is also used by the layout class.

$move(<x>,<y>) Moves this widget to the coordinate <x> and <y> relative to its parent widget (or the desktop if this widget is a toplevel one). This is equivalent to $setGeometry(<x>,<y>, $width(),$height()).

$resize(<width>,<height>) Changes the widget's width to <width> and height to <height>. See also $setGeometry().


$isEnabled() Returns '1' if the widget is enabled , '0' otherwise. See also $setenabled().


$setEnabled(<bool>) Sets the widget state to enabled or disabled if <bool> is 1 or 0 respectively. A disabled widget does not receive keyboard nor mouse input.


$setCaption(<text>) Sets the caption of this widget to <text>. This is meaningful for toplevel widgets only.


$setToolTip(<tooltip_text>) Set the tooltip of this widget; the text can contain HTML formatting.


$caption() Returns the caption text of this widget.


$isTopLevel() Returns '1' if this widget is a toplevel (parentless) one, '0' otherwise.


$isVisible() Returns '1' if this widget is currently visible (read: is managed by the window manager and displayed by the X server; the widget may be hidden behind other widgets). If the widget is not visible this function returns '0'. See also $show() and $hide().


$raise() Moves this widget to the top of the stack of the widgets relative to its parent. See also $lower.


$lower() Moves this widget to the bottom of the stack of the widgets relative to its parent. See also $raise


$hasFocus() Returns '1' if this widget has the keyboard focus. See also $setFocus.


$setFocus() Sets this widget to be the one that receives keyboard events. See also $hasFocus


$parentWidget() Returns the object id of the parent widget, or '0' if this widget is a toplevel one.


$backgroundColor() Returns the background color of this widget in hexadecimal html-like format. For example , for a black bacground you will get the string "000000" , for a red one , "FF0000", for a white one "FFFFFF". See also $setBackgroundColor()


$setBackgroundColor(<color>) Sets the background color of this widget to <color>.


$setForegroundColor(<color>) Sets the foreground color of this widget to <color>. <color> must be a string with 6 hexadecimal digits (like the ones used to specify colors in html pages). The first two digits specify the RED component, the third and fourth digit specify the GREEN component and the last two specify the BLUE component. For example "FFFF00" means full red, full green and no blue that gives a yellow color, "808000" designates a brown color (dark yellow), "A000A0" is a kind of violet. See also $foregroundColor.


$foregroundColor() Returns the foreground color of this widget in hexadecimal html-like format. See also $setForegroundColor.


$setMouseTracking(<bool>) Enables or disables the mouse tracking if <bool> is '1' or '0' respectively. When mouse tracking is enabled you will receive mouse move events even if no button is pressed, otherwise you will receive it only when a mouse button is being pressed (so after a mousePressEvent).


$mousePressEvent(<button>,<x>,<y>) This function is called when a mouse button is pressed while the cursor is in this widget. <button> is 0 if the pressed button is the left one, 1 if the button is the right one and 2 if it is the middle one. The <x> and <y> coordinates are relative to this widget upper-left corner and are expressed in pixels. If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$mouseReleaseEvent(<button>,<x>,<y>) This function is called when a mouse button is released while the cursor is in this widget. <button> is 0 if the released button is the left one, 1 if the button is the right one and 2 if it is the middle one. The <x> and <y> coordinates are relative to this widget upper-left corner and are expressed in pixels. If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$mouseDoubleClickEvent(<button>,<x>,<y>) This function is called when a mouse button is double clicked while the cursor is in this widget. <button> is 0 if the double clicked button is the left one, 1 if the button is the right one and 2 if it is the middle one. The <x> and <y> coordinates are relative to this widget upper-left corner and are expressed in pixels. If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$mouseMoveEvent(<button>,<x>,<y>) This function is called when the mouse cursor moves inside this widget. <button> is 0 if the pressed button is the left one, 1 if the button is the right one and 2 if it is the middle one. The special value of -1 indicates that no button is being pressed. The <x> and <y> coordinates are relative to this widget upper-left corner and are expressed in pixels. Normally you will receive this event only if a mouse button is being pressed while moving. If you want to receive it also when the mouse buttons are not pressed, call $setMouseTracking(). If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$focusInEvent() This function is called when this widget gains keyboard focus. If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$focusOutEvent() This function is called when this widget looses keyboard focus. If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$mouseLeaveEvent() This function is called when the mouse leaves this widget. If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$mouseEnterEvent() This function is called when the mouse enters this widget. If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$showEvent() This function is called when this widget is being shown. If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$hideEvent() This function is called when this widget is being hidden. If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$closeEvent() This function is called when this widget is going to be closed. If you call "setreturn 1" you will ignore the close event. The default implementation does nothing.


$resizeEvent() This function is called immediately after this widget has been resized. If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$moveEvent() This function is called immediately after this widget has been moved. If you call "setreturn 1" you will stop the internal processing of this event. The default implementation does nothing.


$paintEvent() This event handler can be reimplemented to repaint all or part of the widget. It's needed by the Painter class. It's very useful for drawing flicker free animations or low level special graphic effects. The default implementation does nothing.


$setIcon(<image_id>) Sets the icon for this widget. This is meaningful only for toplevel widgets. See the image identifier documentation for the explaination of the <image_id> parameter.


$setBackgroundImage(<image_id>) Sets the background image for this widget. See the image identifier documentation for the explaination of the <image_id> parameter. For some kind of widgets, setting a background pixmap may have no effect or have strange results. Experiment with it. To unset the background image call $setBackgroundColor


$setFont(<size>,<family>,<style>) Set the font's size, family and stile, valid flag for style are:


italic     
bold     
underline      
overline    
strikeout  
fixedpitch  


$setWFlags(<flag1>, <flag2>, ...) This function sets widget flags, given as parameters. Valid flags are:


TopLevel   - indicates that this widget is a top-level widget
Dialog     - indicates that this widget is a top-level window that should be decorated as a dialog
Desktop    - indicates that this widget is the desktop
Popup      - indicates that this widget is a popup top-level window
Customize  - let's the user to customize the style of the widget. Valid parameter for a customized widget are:
Title      - gives the window a title bar
StaysOnTop - window stays on top
SysMenu    - add a windows system menu
Minimize   - add a minimize button for the sysmenu style
Maximize   - add a maximixe button for the sysmenu style


$centerToScreen() Centers the window on the screen (useful only for toplevel widgets). The best place to call this function is in $showEvent() $setFocusPolicy(<key focus>) Sets the way the widget accepts keyboard focus. Valid parameters are:


- TabFocus;    (widget accepts keyboard focus by tabbing)
- ClickFocus;  (widget accepts keyboard focus by clicking)
- StrongFocus; (widget accepts both tabbing/clicking)
- No Focus;    (widget does not accept focus at all; this is the default value)


$keyPressEvent(<key>) If widget accepts keyboard focus (see $setFocusPolicy ) this function handles for keys; In its argument the key pressed. Special keys are:


- Return
- Enter
- Down (cursor arrow down)
- Up   (cursor arrow up)
- Left (cursor arrow left)
- Right (cursor arrow right)
- Shift
- Ctrl
- Alt
- CapsLock
- Backspace
- Del
- Esc
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- +
- -
- *
- /
- (
- )
- =
- .
- ^


$mapFromGlobal(<x>,<y>) Translates the global screen coordinate pos to widget coordinates.


$mapToGlobal(<x>,<y>) Translates widget coordinates into the global screen coordinate pos.

[править] Кнопка

A simple, well-known button


Inherits object widget


Description A button - nothing more, nothing else...


Functions $setText(<text:string>) This function sets the text for this button.


<string> $text() Returns the current text of the button


$setImage(<image_id:string>) Sets the image to be displayed on this label. Giving empty argument clears the pixmap See the image identifier documentation for the explaination of the <image_id> parameter.


$clickEvent() This function is called by the framework when the button is clicked. You can reimplement it to handle the user click events. The default implementation emits the $clicked() signal, so it is easy to handle the clicks from many buttons without reimplementing the $clickEvent() for every one. Note: If you reimplement this function to catch the user click events, you will have to emit the signal by yourself (if you still need it , obviously).


Signals $clicked() This signal is emitted by the default implementation of [classfnc]clickEvent[/classfnc](). If you reimplement that function you will have to emit the signal manually (if you still need it).

Личные инструменты
Инструменты
Наши кнопки
Размести кнопку KVirc у себя на сайте:
www.kvirc.ru - кроссплатформенный IRC клиент с богатым графическим интерфейсом и внутренним языком скриптинга
Друзья и спонсоры
  • Fireforge.net
Linux coutner