readme update
This commit is contained in:
parent
81f03182c4
commit
44e31bd115
|
@ -1,7 +1,7 @@
|
|||
The Final Cut [![Build Status](https://travis-ci.org/gansm/finalcut.svg?branch=master)](https://travis-ci.org/gansm/finalcut)
|
||||
=============
|
||||
The Final Cut is a programming library and widget toolkit that creates a text-based user interface with full mouse support. It supports the controlled handling of multiple simultaneous windows.
|
||||
The C++ class design is inspired by the Qt framework. It offers common user interface elements like dialog windows, push buttons, check boxes, radio buttons, input lines, list boxes, status bars and so on.
|
||||
The Final Cut is a class library and widget toolkit with full mouse support for creating a text-based user interface. The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple windows on the screen.
|
||||
The C++ class design was inspired by the Qt framework. It provides common controls like dialog windows, push buttons, check boxes, radio buttons, input lines, list boxes, status bars and so on.
|
||||
|
||||
![](https://github.com/gansm/finalcut/blob/master/doc/fileopen-dialog.png)
|
||||
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
The Final Cut
|
||||
----------------------------------------------------------------------
|
||||
|
||||
The Final Cut is a programming library and widget toolkit that creates
|
||||
a text-based user interface with full mouse support. It supports the
|
||||
controlled handling of multiple simultaneous windows.
|
||||
The C++ class design is inspired by the Qt framework. It offers common
|
||||
user interface elements like dialog windows, push buttons, check boxes,
|
||||
The Final Cut is a class library and widget toolkit with full mouse
|
||||
support for creating a text-based user interface. The library supports
|
||||
the programmer to develop an application for the text console. It allows
|
||||
the simultaneous handling of multiple windows on the screen.
|
||||
|
||||
The C++ class design was inspired by the Qt framework. It provides
|
||||
common controls like dialog windows, push buttons, check boxes,
|
||||
radio buttons, input lines, list boxes, status bars and so on.
|
||||
|
||||
|
|
|
@ -39,6 +39,21 @@ FMenu::FMenu (const char* txt, FWidget* parent) : FWindow(parent)
|
|||
//----------------------------------------------------------------------
|
||||
FMenu::~FMenu()
|
||||
{
|
||||
activatePrevWindow();
|
||||
delWindow(this);
|
||||
|
||||
const FRect& geometry = getGeometryGlobalShadow();
|
||||
restoreVTerm (geometry);
|
||||
parentWidget()->redraw(); // ????
|
||||
|
||||
if ( vwin != 0 )
|
||||
{
|
||||
if ( vwin->changes != 0 )
|
||||
delete[] vwin->changes;
|
||||
if ( vwin->text != 0 )
|
||||
delete[] vwin->text;
|
||||
delete vwin;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -46,8 +61,35 @@ FMenu::~FMenu()
|
|||
//----------------------------------------------------------------------
|
||||
void FMenu::init()
|
||||
{
|
||||
width = 10;
|
||||
height = 2;
|
||||
xmin = 1;
|
||||
ymin = 1;
|
||||
xmax = width;
|
||||
ymax = height;
|
||||
client_xmin = 1;
|
||||
client_ymin = 1;
|
||||
client_xmax = width;
|
||||
client_ymax = height;
|
||||
top_padding = 1;
|
||||
left_padding = 1;
|
||||
bottom_padding = 1;
|
||||
right_padding = 1;
|
||||
createArea (vwin);
|
||||
setGeometry (1, 1, 10, 2, false); // initialize geometry values
|
||||
ignore_padding = true;
|
||||
window_object = true;
|
||||
addWindow(this);
|
||||
setActiveWindow(this);
|
||||
|
||||
FWidget* old_focus = FWidget::getFocusWidget();
|
||||
if ( old_focus )
|
||||
{
|
||||
setFocus();
|
||||
old_focus->redraw();
|
||||
}
|
||||
|
||||
item->setMenu(this);
|
||||
setGeometry (1,1,1,1);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -93,7 +135,18 @@ int FMenu::getHotkeyPos (wchar_t*& src, wchar_t*& dest, uInt length)
|
|||
//----------------------------------------------------------------------
|
||||
void FMenu::draw()
|
||||
{
|
||||
if ( itemlist.empty() )
|
||||
return;
|
||||
|
||||
// fill the background
|
||||
setColor (foregroundColor, backgroundColor);
|
||||
setUpdateVTerm(false);
|
||||
clrscr();
|
||||
drawBorder();
|
||||
|
||||
drawItems();
|
||||
|
||||
setUpdateVTerm(true);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -102,11 +155,6 @@ void FMenu::drawItems()
|
|||
std::vector<FMenuItem*>::const_iterator iter, end;
|
||||
int y = 1;
|
||||
|
||||
if ( itemlist.empty() )
|
||||
return;
|
||||
|
||||
setUpdateVTerm(false);
|
||||
|
||||
iter = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
|
||||
|
@ -144,7 +192,7 @@ void FMenu::drawItems()
|
|||
}
|
||||
gotoxy (xpos+xmin+1, ypos+ymin+y);
|
||||
setColor (foregroundColor, backgroundColor);
|
||||
print (vmenubar, ' ');
|
||||
print (' ');
|
||||
|
||||
txt = (*iter)->getText();
|
||||
txt_length = int(txt.getLength());
|
||||
|
@ -169,13 +217,13 @@ void FMenu::drawItems()
|
|||
setColor (wc.menu_hotkey_fg, wc.menu_hotkey_bg);
|
||||
if ( ! isNoUnderline )
|
||||
setUnderline();
|
||||
print (vmenubar, item_text[z]);
|
||||
print (item_text[z]);
|
||||
if ( ! isNoUnderline )
|
||||
unsetUnderline();
|
||||
setColor (foregroundColor, backgroundColor);
|
||||
}
|
||||
else
|
||||
print (vmenubar, item_text[z]);
|
||||
print (item_text[z]);
|
||||
}
|
||||
|
||||
if ( isActive && isSelected )
|
||||
|
@ -185,7 +233,6 @@ void FMenu::drawItems()
|
|||
++iter;
|
||||
y++;
|
||||
}
|
||||
setUpdateVTerm(true);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -350,8 +397,8 @@ void FMenu::setGeometry (int xx, int yy, int ww, int hh, bool adjust)
|
|||
int old_width = width;
|
||||
int old_height = height;
|
||||
FWidget::setGeometry (xx, yy, ww, hh, adjust);
|
||||
if ( vmenubar && (width != old_width || height != old_height) )
|
||||
resizeArea (vmenubar);
|
||||
if ( vwin && (width != old_width || height != old_height) )
|
||||
resizeArea (vwin);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -102,9 +102,3 @@ void FMenuList::clear()
|
|||
itemlist.clear();
|
||||
}
|
||||
|
||||
|
||||
// protected methods of FMenuList
|
||||
//----------------------------------------------------------------------
|
||||
/*void FMenuList::cb_item_activated (FWidget*, void*)
|
||||
{
|
||||
}*/
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
│ FMenuList ├-------┤ FMenuItem │
|
||||
└───────────┘◄───┐ └───┬───────┘
|
||||
┌─────────┐ │ ┌───┴───┐
|
||||
│ FWidget │◄───┴──┤ FMenu │
|
||||
│ FWindow │◄───┴──┤ FMenu │
|
||||
└─────────┘ └───────┘
|
||||
*/
|
||||
|
||||
|
|
Loading…
Reference in New Issue