-
MY PROJECTS
-
Recent Posts
- SpringBoot.Making our first starter and autoconfiguration
- Spring. Creating main annotation to start business logic
- Spring.Reading from properties file
- Spring.How to define spring version inside springBoot ?
- SpringBoot App inside Docker
- Kafka.FirstExperience
- Docker.MySql and Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- Gradle.Tips
- Spring.AppConfig
- Leetcode.Best-time-to-buy-and-sell-stock
- LeetCode.ClimbStairs.Fibbonacci
- Leetcode.Roman-to-integer
- LeetCode.Palindrome-number
- Java.DesignPatterns.Lightweight
- Java.DesignPatterns.Proxy
- Java.DesignPatterns.Facade
- Java.DesignPatterns.Composite
- Java.DesignPatterns.Bridge
- Java. Strange OOP thing
- Java.Classpath
Categories
- Aptana
- Azure
- C#
- DataSnap
- DBExpress
- Delphi
- Delphi и сети
- Delphi. Язык программирования
- ExtJS
- FastReport
- FireDAC
- FireMonkey
- GIT
- ICS
- IDE
- IIS
- Indy
- InnoSetup
- javascript
- jQuery
- JSON
- LiveBindings
- MSHTML
- MySQL
- PHP
- REST
- Ribbons
- SMS
- SQL инструкции
- SVN
- TRichView
- UniGui
- WebBroker
- WinAPI
- Windows
- Алгоритмы
- Без рубрики
- Деревья
- Ищу ответ
- Компонентостроение
- Мои компоненты
- Начальный уровень
- Обработка исключений
- Парсинг
- Потоки(Threads)
- Регулярные выражения
- Тестирование приложений
Daily Archives: 13.11.2015
TAction simple example (Copy Cut Paste)
На форме FireMonkey – Memo, ActionList, MainMenu В ActionList добавим 3 элемента acCopy acCut acPaste Напишем обработчики для элементов ActionList
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
procedure TForm1.acCopyExecute(Sender: TObject); begin Memo.CopyToClipboard; end; procedure TForm1.acCutExecute(Sender: TObject); begin Memo.CutToClipboard; end; procedure TForm1.acPasteExecute(Sender: TObject); begin Memo.PasteFromClipboard; end; |
Далее – актуализируем через Update
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
procedure TForm1.acCopyUpdate(Sender: TObject); begin acCopy.Enabled := (Memo.SelLength>0); end; procedure TForm1.acCutUpdate(Sender: TObject); begin acCut.Enabled:=(Memo.SelLength>0) end; procedure TForm1.acPasteUpdate(Sender: TObject); var Clip:IFMXClipboardService; s:string; begin if TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService,IInterface(Clip)) then begin s:=Clip.GetClipboard.ToString; acPaste.Enabled:=s.Length>0 end else acPaste.Enabled:=false; end; |
Posted in Delphi, FireMonkey
Comments Off on TAction simple example (Copy Cut Paste)