Конференция "KOL" » Rich Edit , KolOleRe2 [Delphi, Windows]
 
  • RusSun © (19.09.11 16:46) [0]
    Доброе время суток. Уважаемые форумчане.

    Пытаюсь оживить следующий пример
    с сайта Thaddy de Koning  http://www.thaddy.co.uk/koltomdemo.zip
    пока застреваю на этом

    [Error] NewActions.pas(65): Undeclared identifier: 'TCtrlKind'
    [Error] NewActions.pas(65): Undeclared identifier: 'TOnUpdateCtrlEvent'
    [Error] NewActions.pas(68): Undeclared identifier: 'PControlRec'
    [Error] NewActions.pas(139): Incompatible types
    [Error] NewActions.pas(140): Pointer type required
    [Error] NewActions.pas(141): Undeclared identifier: 'Ctrl'
    [Error] NewActions.pas(142): Undeclared identifier: 'CtrlKind'
    [Error] NewActions.pas(143): Undeclared identifier: 'ItemID'
    [Error] NewActions.pas(144): Undeclared identifier: 'UpdateProc'
    [Error] NewActions.pas(152): Undeclared identifier: 'ckControl'
    [Error] NewActions.pas(152): Not enough actual parameters
    [Error] NewActions.pas(158): Undeclared identifier: 'ckMenu'
    [Error] NewActions.pas(158): Not enough actual parameters
    [Error] NewActions.pas(164): Undeclared identifier: 'ckToolbar'
    [Error] NewActions.pas(164): Not enough actual parameters
    [Error] NewActions.pas(276): Missing operator or semicolon
    [Error] NewActions.pas(281): Pointer type required
    [Error] NewActions.pas(281): Undeclared identifier: 'Ctrl'
    [Error] NewActions.pas(297): Pointer type required
    [Error] NewActions.pas(297): Undeclared identifier: 'ItemID'
    [Error] NewActions.pas(321): Pointer type required
    [Error] NewActions.pas(321): Undeclared identifier: 'Ctrl'
    [Error] NewActions.pas(322): Undeclared identifier: 'ItemID'
    [Fatal Error] KolTomDemo1.pas(24): Could not compile used unit 'NewActions.pas'



    Здесь текущий вариант http://narod.ru/disk/25613740001/koltomdemo_%D0%BD%D0%B5%20%D1%80%D0%B0%D0%B1.rar.html
    Хотел сделать следующую вещь которая уже реализована в

    KOLOleRichEdit , расширяющий стандартный Rich Edit возможностью вставлять изображения и другие объекты. Автор: Александр Шахайло
    Но у меня не получается прикрутить меню к KOLOleRichEdit.
    Здесь пример того что получилось http://narod.ru/disk/25618996001/RichOle_%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%20%D0%A8%D0%B0%D1%85%D0%B0%D0%B9%D0%BB%D0%BE.rar.html
    В примере меню не в  KOLOleRichEdit, а на самой форме.

    Может есть варианты как это можно сделать?

    В третьем случае я пытался сделать вставку картинки bmp в Rich Edit.
    нашел в DRKB статью вставка в Rich Edit. Есть файл для вставки рисунка в Rich. Вот http://narod.ru/disk/25621710001/re_bmp.pas.html
    Вставка делается так
    procedure PMPASTE (Dummy : Pointer;Sender: PMenu);
    begin
    if not OpenClipboard( Applet.GetWindowHandle ) then Exit;
    OpenClipboard(0);
    try    
    if IsClipboardFormatAvailable( CF_BITMAP )then  begin

                    if BM = nil then Bm := NewBitmap( 0, 0 );
                    bm.Handle:= GetClipboardData(CF_BITMAP);
                    InsertBitmapToRE(memo.Handle,Bm.Handle);

    end;  

    finally
      CloseClipboard;
         end; //finally
    memo.Perform(WM_PASTE, 0, 0) //для простого текста
    end;


    Получилось. При сохранении в документ rtf картинка сохраняется. Если снова открыть файл, то рисунок не будет загружен.

    Вопрос: Как прикрутить pop меню к KOLOleRichEdit?

    2 Вопрос: Есть документ rtf с картинкой. При загрузке рисунок не появляется? Можно сделать чтобы рисунок загружался?
  • RusSun © (21.09.11 12:54) [1]
    делаю в Delphi 7.


    > Вопрос: Как прикрутить pop меню к ?
    >

    KOLOleRichEdit :

    http://kolmck.net/Components/dde_ole_activex/KOLOleRE.zip

    пробую так  
    rich.SetAutoPopupMenu( PopupMenu );

    И меню не появляется.
  • thaddy © (03.10.11 16:05) [2]
    KolOleRe2 is rather old. The TOM functionality is included in the standard KolRichEdit now. (Because it was so simple)
    The code should work though, it works here. Even with FPC 2.4.4+
  • RusSun © (03.10.11 18:59) [3]
    In my case, I would like to insert a picture into the text. What I did. But just do not insert wondering if I can not get something that is stored again. : (KolRichEdit now does not load the image, and KolOleRe2 it does, but is unable to connect popmenu.

    Upon request, I agreed to try to make a simple widget for notes, save the text in rtf format. But I can not provide it in this form can be read can not keep. He has autosave. Finished writing a note kept closed. The condition that the text can be inserted image.
  • Дмитрий К © (04.10.11 07:21) [4]

    > Вопрос: Как прикрутить pop меню к KOLOleRichEdit?

    procedure TForm1.reMouseUp(Sender: PControl; var Mouse: TMouseEventData);
    var p: TPoint;
    begin
     if Mouse.Button <> mbRight then
       Exit;
     p.X := Mouse.X;
     p.Y := Mouse.Y;
     ClientToScreen(Sender.Handle, p);
     menu.Popup(p.X, p.Y);
    end;

  • RusSun © (07.10.11 17:28) [5]
    Спасибо to Дмитрий К. То что нужно:)
 
Конференция "KOL" » Rich Edit , KolOleRe2 [Delphi, Windows]
Есть новые Нет новых   [119247   +13][b:0][p:0.002]