| 1 |
/* |
| 2 |
vmenu.cpp |
| 3 |
|
| 4 |
Обычное вертикальное меню |
| 5 |
а так же: |
| 6 |
* список в DI_COMBOBOX |
| 7 |
* список в DI_LISTBOX |
| 8 |
* ... |
| 9 |
*/ |
| 10 |
/* |
| 11 |
Copyright (c) 1996 Eugene Roshal |
| 12 |
Copyright (c) 2000 Far Group |
| 13 |
All rights reserved. |
| 14 |
|
| 15 |
Redistribution and use in source and binary forms, with or without |
| 16 |
modification, are permitted provided that the following conditions |
| 17 |
are met: |
| 18 |
1. Redistributions of source code must retain the above copyright |
| 19 |
notice, this list of conditions and the following disclaimer. |
| 20 |
2. Redistributions in binary form must reproduce the above copyright |
| 21 |
notice, this list of conditions and the following disclaimer in the |
| 22 |
documentation and/or other materials provided with the distribution. |
| 23 |
3. The name of the authors may not be used to endorse or promote products |
| 24 |
derived from this software without specific prior written permission. |
| 25 |
|
| 26 |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 27 |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 28 |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 29 |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 30 |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 31 |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 32 |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 33 |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 34 |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 35 |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 36 |
*/ |
| 37 |
|
| 38 |
#include "headers.hpp" |
| 39 |
#include <vector> |
| 40 |
#include <algorithm> |
| 41 |
#include "vmenu.hpp" |
| 42 |
#include "keyboard.hpp" |
| 43 |
#include "lang.hpp" |
| 44 |
#include "keys.hpp" |
| 45 |
#include "macroopcode.hpp" |
| 46 |
#include "colors.hpp" |
| 47 |
#include "chgprior.hpp" |
| 48 |
#include "dialog.hpp" |
| 49 |
#include "savescr.hpp" |
| 50 |
#include "clipboard.hpp" |
| 51 |
#include "ctrlobj.hpp" |
| 52 |
#include "manager.hpp" |
| 53 |
#include "constitle.hpp" |
| 54 |
#include "syslog.hpp" |
| 55 |
#include "interf.hpp" |
| 56 |
#include "palette.hpp" |
| 57 |
#include "config.hpp" |
| 58 |
#include "processname.hpp" |
| 59 |
#include "pathmix.hpp" |
| 60 |
#include "cmdline.hpp" |
| 61 |
#include "UsedChars.hpp" |
| 62 |
#include "help.hpp" |
| 63 |
|
| 64 |
VMenu::VMenu(const wchar_t *Title, // заголовок меню |
| 65 |
MenuDataEx *Data, // пункты меню |
| 66 |
int ItemCount, // количество пунктов меню |
| 67 |
int MaxHeight, // максимальная высота |
| 68 |
DWORD Flags, // нужен ScrollBar? |
| 69 |
FARWINDOWPROC Proc, // обработчик |
| 70 |
Dialog *ParentDialog) |
| 71 |
: // родитель для ListBox |
| 72 |
strTitle(Title), |
| 73 |
SelectPos(-1), |
| 74 |
TopPos(0), |
| 75 |
MaxLength(0), |
| 76 |
BoxType(DOUBLE_BOX), |
| 77 |
ParentDialog(ParentDialog), |
| 78 |
VMenuProc(Proc ? Proc : (FARWINDOWPROC)VMenu::DefMenuProc), |