SynEdit Questions lazarus / 31-LCL ---------------------------------------------------------------------- captian jaster · 2010-08-13 23:33 Whats the property name for the strings highlited? I checked the LCL site but i cant find it :\ http://lazarus-ccr.sourceforge.net/docs/lcl/ And for my second question.. The Undo Procedure in lazarus Undos all of the things i backspaced. The TSynEdit.Undo does it Char By Char Or should i use a SynMemo? Thanks ---------------------------------------------------------------------- Martin_fr · 2010-08-14 00:02 eoGroupUndo in Synedit.Options Which Highlight you mean? - Selection? BlockBegin, BlockEnd, SelAvail,     property DefaultSelectionMode;     property SelectionMode;     property SelectedColor; - color for same word as word under caret     property HighlightAllColor; ---------------------------------------------------------------------- captian jaster · 2010-08-14 01:21 The eoGroup thing works By Highlight i mean the selected Strings yes But how do you use SelAvail? I did it with a basic IF NOT Code And IF  code and nothing worked ;_; ---------------------------------------------------------------------- Martin_fr · 2010-08-14 10:23 Quote from: captain jaster on August 14, 2010, 03:21:07 amBy Highlight i mean the selected Strings yes I am still unsure what you mean? "selected Strings" is plural. There is only one selection? SelAvail is boolean, so   "if not SelAvail then raise exception('no selection made'); should work (but is a bit of an overreaction) You get the text via  SynEdit.SelText Search the unit ide/SourceEditor.pp for examples ---------------------------------------------------------------------- captian jaster · 2010-08-14 23:39 Sorry for not being clear before.. By select I mean when you click and then highlight a text  (For copying etc,etc). I never found the SelText which is odd... I know selAvail is boolean but i did a basic code with a Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i IF NOT(SynEdit.SelAvail)Thenbegin   MyDropItem.Enabled := False;end; But even when i did Highlight a text it wouldn't Enabled itself :p (Tried it with the NOT code but not with the Else yet.. That could be the problem) Maybe its not what im looking for. Thanks again Martin ---------------------------------------------------------------------- Martin_fr · 2010-08-14 23:57 Well you need to show more of your code. Where (in which event) to you do the "if", maybe you check at a time where it hasn't been changed yet? Also you only pasted code, to set enabled to False? I assume you also have a line to set it to True? why not xxx.Enabled := {not} Synedit.selavail; ? There is an event Synedit.OnStatusChange     property OnStatusChange: TStatusChangeEvent   TStatusChangeEvent = procedure(Sender: TObject; Changes: TSynStatusChanges)     of object;   TSynStatusChange = (scCaretX, scCaretY,     scLeftChar, scTopLine, scLinesInWindow,     scInsertMode, scModified, scSelection, scReadOnly    );   TSynStatusChanges = set of TSynStatusChange; if the reason is scSelection then the selection changed (either on, off or content) you can also do     procedure RegisterStatusChangedHandler(AStatusChangeProc: TStatusChangeEvent; AChanges: TSynStatusChanges);     procedure UnRegisterStatusChangedHandler(AStatusChangeProc: TStatusChangeEvent); in which case you only get called for the events in your filter/mask ---------------------------------------------------------------------- captian jaster · 2010-08-14 23:59 TI fixed just now using the SelText code Turns out i did need the Else code. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TMainForm.EditDropClick(Sender: TObject);begin  IF(EditBox.SelText = '')Then  begin    CopyItem.Enabled := False;    CutItem.Enabled := False;  end Else  begin    CopyItem.Enabled := True;    CutItem.Enabled := True;  end;end; ---------------------------------------------------------------------- Martin_fr · 2010-08-15 00:05 ok I mis-assumed ... in the OnSynEditStatuschanged if scSelection in Changes then begin   CopyItem.Enabled := SynEdit.SelAvail;   CutItem.Enabled := SynEdit.SelAvail; end; much shorter. and faster too. ---------------------------------------------------------------------- captian jaster · 2010-08-15 00:16 Cool.. Ill work on the soon Thanks