Свойство | Тип | Описание | |
---|---|---|---|
Container | |||
Fill | Fill | ||
h | int | ||
w | int | ||
x | int | ||
y | int |
Метод | Описание | |
---|---|---|
BaseMove ( int line, int col ) : void |
Move relative to the top of the container This moves the current cursor position to the specified line and column relative to the start of the container where this widget is located. The difference between this method and Move is that this method goes to the beginning of the container, while Move goes to the first position that widgets should use. For example, a Frame usually takes up a couple of characters for padding. This method would position the cursor at the beginning of the frame, while Move would position the cursor within the frame. |
|
Clear ( ) : void |
Clears the widget region withthe current color. This clears the entire region used by this widget. |
|
DoSizeChanged ( ) : void |
Method to relayout on size changes. This method can be overwritten by widgets that might be interested in adjusting their contents or children (if they are containers). |
|
DrawFrame ( int col, int line, int width, int height ) : void |
Utility function to draw frames Draws a frame with the current color in the specified coordinates. |
|
DrawFrame ( int col, int line, int width, int height, bool fill ) : void |
Utility function to draw frames Draws a frame with the current color in the specified coordinates. |
|
DrawHotString ( string s, int hotcolor, int color ) : void |
Utility function to draw strings that contain a hotkey Draws a string with the given color. If a character "_" is found, then the next character is drawn using the hotcolor. |
|
Log ( string s ) : void |
Utility function to log messages This is a utility function that you can use to log messages that will be stored in a file (as curses has taken over the screen and you can not really log information there). The data is written to the file "log2" for now |
|
Move ( int line, int col ) : void |
Moves inside the first location inside the container This moves the current cursor position to the specified line and column relative to the container client area where this widget is located. The difference between this method and BaseMove is that this method goes to the beginning of the client area inside the container while BaseMove goes to the first position that container uses. For example, a Frame usually takes up a couple of characters for padding. This method would position the cursor inside the client area, while BaseMove would position the cursor at the top of the frame. |
|
PositionCursor ( ) : void |
Moves inside the first location inside the container A helper routine that positions the cursor at the logical beginning of the widget. The default implementation merely puts the cursor at the beginning, but derived classes should find a suitable spot for the cursor to be shown. This method must be overwritten by most widgets since screen repaints can happen at any point and it is important to leave the cursor in a position that would make sense for the user (as not all terminals support hiding the cursor), and give the user an impression of where the cursor is. For a button, that would be the position where the hotkey is, for an entry the location of the editing cursor and so on. |
|
ProcessColdKey ( int key ) : bool |
This method can be overwritten by widgets that want to provide accelerator functionality (Alt-key for example), but without interefering with normal ProcessKey behavior. After keys are sent to the widgets on the current Container, all the widgets are processed and the key is passed to the widgets to allow some of them to process the keystroke as a cold-key. This functionality is used, for example, by default buttons to act on the enter key. Processing this as a hot-key would prevent non-default buttons from consuming the enter keypress when they have the focus. |
|
ProcessHotKey ( int key ) : bool |
This method can be overwritten by widgets that want to provide accelerator functionality (Alt-key for example). Before keys are sent to the widgets on the current Container, all the widgets are processed and the key is passed to the widgets to allow some of them to process the keystroke as a hot-key. For example, if you implement a button that has a hotkey ok "o", you would catch the combination Alt-o here. If the event is caught, you must return true to stop the keystroke from being dispatched to other widgets. Typically to check if the keystroke is an Alt-key combination, you would use Curses.IsAlt(key) and then Char.ToUpper(key) to compare with your hotkey. |
|
ProcessKey ( int key ) : bool |
If the widget is focused, gives the widget a chance to process the keystroke. Widgets can override this method if they are interested in processing the given keystroke. If they consume the keystroke, they must return true to stop the keystroke from being processed by other widgets or consumed by the widget engine. If they return false, the keystroke will be passed out to other widgets for processing. |
|
ProcessMouse ( |
Gives widgets a chance to process the given mouse event. Widgets can inspect the value of ev.ButtonState to determine if this is a message they are interested in (typically ev.ButtonState & Curses.Event.Button1Clicked). |
|
Redraw ( ) : void |
Redraws the current widget, must be overwritten. This method should be overwritten by classes that derive from Widget. The default implementation of this method just fills out the region with the character 'x'. Widgets are responsible for painting the entire region that they have been allocated. |
|
Widget ( int x, int y, int w, int h ) : System |
Public constructor for widgets Constructs a widget that starts at positio (x,y) and has width w and height h. These parameters are used by the methods Clear and Redraw |
public BaseMove ( int line, int col ) : void | ||
line | int | |
col | int | |
Результат | void |
public static DrawFrame ( int col, int line, int width, int height ) : void | ||
col | int | |
line | int | |
width | int | |
height | int | |
Результат | void |
public static DrawFrame ( int col, int line, int width, int height, bool fill ) : void | ||
col | int | |
line | int | |
width | int | |
height | int | |
fill | bool | |
Результат | void |
public static DrawHotString ( string s, int hotcolor, int color ) : void | ||
s | string | |
hotcolor | int | |
color | int | |
Результат | void |
public Widget ( int x, int y, int w, int h ) : System | ||
x | int | |
y | int | |
w | int | |
h | int | |
Результат | System |