достала "борьба" с лазарем решил отвлечься на мсе.
вот че получилось.
tsyntaxedit крохонький примерчик :)
Модератор: Модераторы
tsyntaxedit крохонький примерчик :)
- Вложения
-
- memomse.zip
- (31.82 КБ) 652 скачивания
Последний раз редактировалось amateur 19.08.2013 11:36:57, всего редактировалось 2 раза.
Some comments:
simpletext.optionswidget1 ow1_autoscale should be true in order to synchronize grid row height with font height.
Instead to use simpletext.onpopup one could set simpletext.popupmenu to tpopupmenu1 and use tpopupmenu1.onupdate.
If simpletext.optionsedit1 oe1_autopoupmenu is true the default popupmenu and the items of tpopupmenu1 will be merged.
Код: Выделить всё
procedure tmainfo.on_popup_edit(const sender: TObject; var amenu: tpopupmenu;
var mouseinfo: mouseeventinfoty);
begin
tpopupmenu1.menu[0].Caption := simpletext.selectedtext;
amenu := tpopupmenu1;
end;
procedure tmainfo.on_update_tpopupmenu1(const sender: tcustommenu); //MSE
begin
sender.menu[0].caption := simpletext.selectedtext;
end;
procedure tmainfo.on_change_spin(const sender: TObject);
begin
// simpletext.font.height := strtoint(trealspinedit1.text); MSE
simpletext.font.height := trealspinedit1.asinteger; //better MSE
end;
procedure tmainfo.on_setvalue_spin(const sender: TObject; var avalue: realty;
var accept: Boolean);
begin
simpletext.font.height:= round(avalue); //much better MSE
end;
procedure tmainfo.on_setintvalue_spin(const sender: TObject;
var avalue: Integer; var accept: Boolean);
//best, needs MSEide+MSEgui git master, MSE
//onsetintvalue was not published for trealspinedit MSE
begin
simpletext.font.height:= avalue;
end;
procedure tmainfo.btn_open(const sender: TObject);
begin
if tfiledialog1.execute = mr_ok then begin
// simpletext.clear; not necessary MSE
simpletext.loadfromfile(tfiledialog1.controller.filename);
end;
end;
simpletext.optionswidget1 ow1_autoscale should be true in order to synchronize grid row height with font height.
Instead to use simpletext.onpopup one could set simpletext.popupmenu to tpopupmenu1 and use tpopupmenu1.onupdate.
If simpletext.optionsedit1 oe1_autopoupmenu is true the default popupmenu and the items of tpopupmenu1 will be merged.
showed how to clean tsyntaxedit.simpletext.clear;
simpletext.font.height:= avalue;
ups
This is a simple example. For more need to relax more
Добавлено спустя 5 минут 23 секунды:
had another idea...tpopupmenu
Добавлено спустя 33 минуты 38 секунд:
Не много поясню.
Пример очень прост. Но в нем показано:
1. Как сделать перенос строк в twidgetgrid
- activate mygrid.optionsgrid og_rowheight in order to allow variable rowhight
in different rows.
- activate mygrid.datacols[0].options1 co1_autorowheight.
- activate simpletext.textflags tf_wordbreak.
- activate simpletext.textflagsactive tf_wordbreak.
Martin
оригинал сообщения более важен...
2. Как пользоваться tfiledialog (не показал что в filter писать, но разбраться то можно
3. Как по двойному щелчку выбрать слово;
4. Фишка showlink (по этому принципу можно организовать не только подчеркивание);
5. Узнать где находится курсор;
6. С помощью trealspinedit проверил глючность данной реализации.
Хотя не учел возможность "подстройки" интерфейса программы при изменении размера шрифта и применение скинов. Ну и не включил пару финтов (просто не сильно разобрался в них).
Малость "поизвращался" 
Теперь (вроде) может copy - paste и еще малость...
сорцы поменял.
debi12345 вспомнил пословицу - бочка меда и ложка дегтя
п.с.
tpopupmenu чет мне он не нравитсо
Теперь (вроде) может copy - paste и еще малость...
сорцы поменял.
debi12345 вспомнил пословицу - бочка меда и ложка дегтя
п.с.
tpopupmenu чет мне он не нравитсо
