AutoHotkey Community

It is currently May 27th, 2012, 6:32 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 240 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16  Next

Do you want HiEdit internaly
Yes
No, I like Edit control
Other (please explain)
You may select 1 option

View results
Author Message
 Post subject:
PostPosted: July 14th, 2010, 8:07 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
You talk about autoindent.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 14th, 2010, 9:03 pm 
Offline

Joined: July 17th, 2008, 9:46 am
Posts: 225
Hi,
I set it to true:
Code:
   ;Add HiEdit Control
   hEdit := HE_Add(hGui,0,60,538,540, "HSCROLL VSCROLL HILIGHT TABBED FILECHANGEALERT", A_ScriptDir . "\resources\RB.dll")
   HE_AutoIndent(   hEdit,   true ) ; set autoindent to true

but I don't see any effect.
Did I made something wrong?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 15th, 2010, 12:40 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
If we talk about the same thing, the deafult _Test.ahk from the archive already have autoindent on (its available via the Features menu).

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 15th, 2010, 9:43 am 
Offline

Joined: July 17th, 2008, 9:46 am
Posts: 225
Thank you, that's what I ment.
I will try to get it working in my AHK Script :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 15th, 2010, 2:22 pm 
Offline

Joined: July 17th, 2008, 9:46 am
Posts: 225
Hi majkinator,

maybe I'm doing something wrong, but my Keywords.hes is not working properly:
Code:
HE_SetKeywordFile( A_ScriptDir . "\Keywords.hes" )


I tried several files..
lg DHMH


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 16th, 2010, 12:15 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Probably missing HILIGHT style when creating control with Add function.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 16th, 2010, 8:36 am 
Offline

Joined: July 17th, 2008, 9:46 am
Posts: 225
no, the 'HIGHLIGHT' style is there :(

EDIT:
I finally got it working :) Don't know what the mistake was, but now it works :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2010, 2:46 am 
Offline

Joined: February 19th, 2010, 8:07 pm
Posts: 614
Hi majkinetor... is it possible to embed the HiEdit control (or the RichEdit for that matter) inside a Tab control?

I tried with the obvious, using the Tab HWND as the parent for the HiEdit control but ahk still draws the Tab on top of the Edit control and changing tabs wont hide HiEdit, it seems like the control is being created with the main window as the parent even though you give the HWND of the Tab control.

I also tried using a Panel control as a container for the HiEdit but it also failed to get embedded inside a Tab. So i assume that all the controls that are in your "_Forms" would not work inside a tab or require special methods to get them there which would be good to know.

I read that some one was able to simulate a RichEdit inside a tab but I didnt understand the concept that he tried (he said a Control, Hide, then move and then Show again). I tried it but nothing worth mentioning happened, so im kind of lost here.

Any info would be appreciated.

--edit

I found a hacky work around, I add the control and hide it, I have a g-label assigned to the Tab that when clicked will show the HiEdit only when the corresponding tab is selected... I still had troubles when resizing the window since the Tab is redrawn on top of the hiEdit control all the time...

What i did is that i as I am using the attach() function on both the tab control and the HiEdit I set the Tab to r1 but the HiEdit to r2 which effectively redraws the tab first and then the HiEdit last thus redrawing everything correctly...

Maybe there is a better solution for all this (like fixing those controls to attach to the tab control instead of the main window for example) but up to now it seems to be working fine. :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2010, 8:52 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
I am not aware of any other solution atm. I don't use tabs, but panel instead.
You can try the same - instead of tabs u can use N panels and devote some interface elements to show adequate panel (via toolbar for example or set of buttons) or even tab control which serves only for navigation.

You have example in Forms framework called PseudoTabs.ahk

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2010, 4:12 pm 
Offline

Joined: February 19th, 2010, 8:07 pm
Posts: 614
Few notes, I have noticed that the highlighter makes the numbers blue by default except for 0 and 1...

If i add a key = value pair for the numbers with a random color the numbers 1 and 0 stay black and the others do take the color I assigned.

But if i do a number like 23 or 522 (more than one digit) they get colored with the default blue color again. I tried using the ! but it makes no difference.

Any info on that?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2010, 4:19 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
There are some problems but I hear first time for 0 or 1.

See:
http://www.autohotkey.com/forum/viewtop ... 618#314618

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2010, 4:54 pm 
Offline

Joined: February 19th, 2010, 8:07 pm
Posts: 614
yeah i saw that table a little while back, i was not using hiEdit still, Im just trying it out because i havent been able to use Scintilla... (i didnt found the wrapper in the forums) and adding the control to the GUI seems little bit tricky.

I do miss the word-wrap function multiline comments and code folding.
I do like the size, speed and the fact that i can have tabs... dont know if i will have to use your RichEdit control instead and create my own syntax highlighter... even though it wouldnt be as fast as your hiEdit control.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2010, 5:07 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
RichEdit control usually can't produce good syn. highlighting features.
Perhaps wrapping up scintilla is the best option if HiEdit doesn't satisfy your needs. HiEdit is not uber programming control - it has some nice features in compact dll with very fast working. For advanced things you need something else, especially as it seems that akyprian will not develop new stuff any more (he wasn't active in previous year on his own forum).


You can check this out it looks very easy
http://www.scintilla.org/Steps.html

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 19th, 2011, 11:09 am 
Offline

Joined: March 27th, 2008, 7:46 pm
Posts: 129
Location: France
:oops: Perhaps, You know ¿ The big problem of Drag And Drop the sélection is solved, with cRichEdit.ahk (a script by corrupt :)

:idea: Just adding in First a RichEdit control and hide him . Like that:
Code:
; FIRST (imperatif) ; Adding This control just for > DragAndDrop the sélection :
; ------------------------------------------- //
Gui Add, Picture,HwndREparent1 x00 y00 w00 h00  vEDIT_RICHEDIT
If A_OSVersion = WIN_95
  cGUI("1:Add:" . REparent1, REdit1, 0, 0, 200, 120, "RICHEDIT")
Else
  cGUI("1:Add:" . REparent1, REdit1, 0, 0, 200, 120, "RichEdit20A")
guicontrol , hide, EDIT_RICHEDIT      ; Hide this control // 
 ; ------------------------------------------- //

 


For that, You need cRichEdit.ahk and cGui.ahk ( by corrupt ) in the folder script or in your standart lib
See that in this forum : http://www.autohotkey.com/forum/viewtopic.php?t=19421&highlight=crichedit+ahk
; DirectDownload: http://www.autohotkey.net/~corr/RichEdit.zip ; by corrupt


:arrow: After, You can Test with this script, a new exemple of _Test.ahk based on script of majkinetor :)

_Test_with_a_RichEdit_control.ahk
Code:
;  _Test_with_a_RichEdit_control.ahk

#SingleInstance force
CoordMode, Mouse, screen
#NoEnv

   Gui, +LastFound +Resize
   hwnd := WinExist()


; FIRST (imperatif) ; Adding This control just for > DragAndDrop the sélection :
; ------------------------------------------- //
Gui Add, Picture,HwndREparent1 x00 y00 w00 h00  vEDIT_RICHEDIT
If A_OSVersion = WIN_95
  cGUI("1:Add:" . REparent1, REdit1, 0, 0, 200, 120, "RICHEDIT")
Else
  cGUI("1:Add:" . REparent1, REdit1, 0, 0, 200, 120, "RichEdit20A")
guicontrol , hide, EDIT_RICHEDIT      ; Hide this control // 
 ; ------------------------------------------- //
   
 
   CreateMenu()
   hEdit := HE_Add(hwnd,0,0,800,600, "HSCROLL VSCROLL HILIGHT TABBED FILECHANGEALERT")


   fStyle := "s9" ,   fFace  := "Courier New"
   HE_SetFont( hEdit, fStyle "," fFace)

   SetColors(hEdit)

   HE_SetTabWidth(hEdit, 4)
   HE_LineNumbersBar(hEdit, "automaxsize"), lineNumbers := true
   HE_AutoIndent(hedit, true), autoIndent := true

   Menu, Features, Check, LineNumbersBar
   Menu, Features, Check, AutoIndent


   HE_SetKeywordFile( A_ScriptDir "\Keywords.hes")
   HE_OpenFile( hEdit, A_ScriptFullPath )

   Attach(hEdit, "w h")
   Gui, Show, w800 h600, HiEdit Test
   
return


; DragAndDrop the sélection :
   #include cRichEdit.ahk          ;   by corrupt
   #include cGui.ahk
; Forum:
; http://www.autohotkey.com/forum/viewtopic.php?t=19421&highlight=crichedit+ahk
; DirectDownload:
; http://www.autohotkey.net/~corr/RichEdit.zip      ; by corrupt
   
      
   
OnHiEdit(Hwnd, Event, Info) {
   OutputDebug % Hwnd " | " Event  " | " Info
}

#IfWinActive, HiEdit Test
F3:: FindNext(hedit)
^F:: Dlg_Find( hwnd, "OnFind" )
^G:: GoToLine()
F1:: MsgBox % """" HE_GetLine(hEdit) """"
#IfWinActive

SetColors(hEdit) {
   colors=
   (
      Text            = 0xFFFFFF
      Back            = 0
      SelText            = 0xFFFFFF
      ActSelBack         = 0xc56a31
      InSelBack         = 0xAAAAAA
      LineNumber         = 0x0
      SelBarBack         = 0xAAAAAA
      NonPrintableBack   = 0xFFFFFF
      Number            = 0xFFFFFF
   )
   HE_SetColors(hEdit, colors )                        
}

CreateMenu(){
   Menu, FileMenu, Add, &New,      MenuHandler 
   Menu, FileMenu, Add, &Close,   MenuHandler
   Menu, FileMenu, Add,
   Menu, FileMenu, Add, &Open,      MenuHandler 
   Menu, FileMenu, Add, &SaveAs,   MenuHandler 
   Menu, FileMenu, Add, Reload,   MenuHandler 
   Menu, FileMenu, Add,
   Menu, FileMenu, Add, E&xit,      MenuHandler

   Menu, Features, Add, GetFileCount,    Features
   Menu, Features, Add, GetFileName,    Features
   Menu, Features, Add,
   Menu, Features, Add, GetCurrentFile, Features
   Menu, Features, Add, SetCurrentFile, Features
   Menu, Features, Add,
   Menu, Features, Add, AutoIndent,   Features
   Menu, Features, Add, SetTabWidth,   Features
   Menu, Features, Add, SetFont,      Features
   Menu, Features, Add, SetColors,      Features
   Menu, Features, Add
   Menu, Features, Add, LineNumbersBar,Features
   Menu, Features, Add, ShowFileList,   Features
   Menu, Features, Add, ConvertCase,   Features
   Menu, Features, Add
   Menu, Features, Add, Enable Events, Features


   Menu, Standard, Add, Undo,          Standard
   Menu, Standard, Add, Redo,          Standard
   Menu, Standard, Add
   Menu, Standard, Add, Find,          Standard
   Menu, Standard, Add, Find Next,       Standard
   Menu, Standard, Add
   Menu, Standard, Add, GetTextRange,    Standard
   Menu, Standard, Add, GetTextLength,    Standard
   Menu, Standard, Add
   Menu, Standard, Add, GetSel,       Standard
   Menu, Standard, Add, SetSel,       Standard
   Menu, Standard, Add, GetSelText,    Standard
   Menu, Standard, Add, ReplaceSel,    Standard
   Menu, Standard, Add, ScrollCaret,    Standard
   Menu, Standard, Add
   Menu, Standard, Add, Go To Line,    Standard
   Menu, Standard, Add, GetLine,       Standard
   Menu, Standard, Add, GetLineCount,    Standard
   Menu, Standard, Add, LineIndex,       Standard
   Menu, Standard, Add, LineLength,    Standard   
   Menu, Standard, Add, GetFirstVisibleLine, Standard
   Menu, Standard, Add
   Menu, Standard, Add, Scroll, Standard

   Menu, MyMenuBar, Add,File,      :FileMenu 
   Menu, MyMenuBar, Add,&Features, :Features
   Menu, MyMenuBar, Add,&Standard,  :Standard
   Menu, MyMenuBar, Add,About,      MenuHandler
   Menu, MyMenuBar, Color,  DDDDDD
   Gui, Menu, MyMenuBar
}


Standard:
   HE_GetSel(hEdit, s, e)

   if A_ThisMenuItem = GetTextRange
      msgbox % "100 chars from carret possition:`n`n" HE_GetTextRange(hEdit, s, s+100)
   
   if A_ThismenuItem = Go To Line
      GoToLine()

   if A_ThismenuItem = GetTextLength
      MsgBox % HE_GetTextLength(hEdit)

   if A_ThismenuItem = GetSelText
      MsgBox % HE_GetSelText(hEdit)   

   if A_ThismenuItem = ScrollCaret
   {
      Msgbox This will scroll caret into the view
      HE_ScrollCaret(hEdit)
   }

   if A_ThismenuItem = GetSel
      MsgBox Selection start: %s%`n`nSelection end: %e%

   if A_ThisMenuItem = SetSel
      HE_SetSel(hEdit, s, s+100)

   if A_ThisMenuItem = ReplaceSel
      HE_ReplaceSel(hEdit, "---")

   if A_ThisMenuItem = Find
      Dlg_Find( hwnd, "OnFind" )

   if A_ThisMenuItem = Find Next
      FindNext( hEdit )

   if A_ThisMenuItem = Undo
      HE_Undo(hEdit)

   if A_ThisMenuItem = Redo
      HE_Redo(hEdit)

   if A_ThisMenuItem = GetLine
      MsgBox % """" HE_GetLine(hEdit) """"

   if A_ThisMenuItem = GetLineCount
      MsgBox % HE_GetLineCount(hEdit)

   if A_ThisMenuItem = LineLength
      MsgBox % HE_LineLength(hEdit)
   
   if A_ThisMenuItem = LineIndex
      msgbox % HE_LineIndex(hEdit)

   if A_ThisMenuItem = GetFirstVisibleLine
      msgbox % HE_GetFirstVisibleLine(hEdit)

   if A_ThisMenuItem = Scroll Page
       HE_Scroll(hEdit, 1, 0)

return

Features:
   if A_ThisMenuItem = ConvertCase
      HE_ConvertCase(hEdit)

   if A_ThisMenuItem = GetFileCount
      MsgBox % HE_GetFileCount(hEdit)

   if A_ThisMenuItem = GetFileName
      Msgbox % HE_GetFileName(hEdit)
   if A_ThisMenuItem = GetCurrentFile
      Msgbox % HE_GetCurrentFile(hEdit)

   if A_ThisMenuItem = SetCurrentFile
   {
      InputBox, idx, SetCurrentFile ,Index of file to activate,,150,120,,,,,0
      if ErrorLevel
         return
      if (idx < HE_GetFileCount(hEdit))
         HE_SetCurrentFile(hEdit, idx)
      else Msgbox Index is too large
   }

   if A_ThisMenuItem = SetTabWidth
   {
      InputBox, w, SetTabWidth ,Set Tab Width,,150,120,,,,,4
      if ErrorLevel
         return
      HE_SetTabWidth(hEdit, w)
   }

   if A_ThisMenuItem = AutoIndent
   {
      Menu, %A_ThisMenu%, ToggleCheck, %A_ThisMenuItem%
      He_AutoIndent(hEdit, autoIndent := !autoIndent)
   }

   if A_ThisMenuItem = LineNumbersBar
   {
      Menu, %A_ThisMenu%, ToggleCheck, %A_ThisMenuItem%
      lineNumbers := !lineNumbers
      HE_LineNumbersBar(hEdit, lineNumbers ? "automaxsize" : "hide")
   }

   if A_ThisMenuItem = SetFont
   {
      if Dlg_Font(fFace, fStyle, pColor, true, hwnd)
         HE_SetFont(hEdit, fStyle "," fFace)
   }

   if A_ThisMenuItem = SetColors
      MsgBox For Homework...
      
   if A_ThisMenuItem = ShowFileList
   {
      MouseGetPos, x, y
      HE_ShowFileList(hEdit, x, y )
      return
   }

   if A_ThisMenuItem = Enable Events
   {
      HE_SetEvents(hEdit, "OnHiEdit", "SelChange Scroll Key Mouse ContextMenu")
      MsgBox Open DebugView to monitor events.
   }

return

OnFind(Event, Flags, FindText) {
   global hEdit
   static _FindText, _Flags, res
   ifEqual, Event, C, return

   if (Flags != "next")
      _FindText := FindText, _Flags := Flags
   else ifEqual, _FindText,, return

   StringReplace, Flags, Flags, d,
   StringReplace, Flags, Flags, c, MATCHCASE%A_SPACE%
   StringReplace, Flags, Flags, w, WHOLEWORD%A_SPACE%

   res := HE_FindText(hEdit, _FindText, HE_GetSel(hEdit)+ (res!="")*1, -1, _Flags)
   if res = 4294967295
   {
      msgbox 4, , %_FindText% not found. Press YES to start searching from beginning.
      IfMsgBox No
         return
      res := "",    HE_SetSel(hEdit, 1), HE_ScrollCaret(hEdit)
      return OnFind("F", _Flags, _FindText)
   }
   HE_SetSel(hEdit, res, res + StrLen(_FindText) )
   HE_ScrollCaret(hEdit)
}

FindNext( hEdit ){
   OnFind(hEdit, "next", "")
}

GoToLine() {
   global hEdit

   cnt := HE_GetLineCount(hEdit)
   InputBox, line, Go To Line, Enter line (1 - %cnt%), , 200, 120
   if ErrorLevel
      return
   if line > cnt
      line := cnt

   line_idx := HE_LineIndex(hEdit, line-1)
   HE_SetSel( hEdit, line_idx, line_idx)
   HE_ScrollCaret(hEdit )
}

MenuHandler:
   if A_ThisMenuItem = &Open
   {
      FileSelectFile, fn
      if Errorlevel
         return
      HE_OpenFile(hEdit, fn)
   }

   if A_ThisMenuItem = E&xit
      ExitApp

   if A_ThisMenuItem = &New
      HE_NewFile(hEdit)

   if A_ThisMenuItem = &Close
      HE_CloseFile(hEdit, -1)

   if A_ThisMenuItem = &SaveAs
   {
      FileSelectFile, fn, S 16
      if (Errorlevel)
         return
      HE_SaveFile(hEdit, fn, -1)
      return
   }

   if A_ThisMenuItem = Reload
      HE_ReloadFile(hEdit)

   if A_ThisMenuItem = About
   {
      msg := "HiEdit AHK demo`n`n"
         . "For more information visit: www.winasm.net`n`n`n"
         . "HiEdit by akyprian`n"
         . "AHK wrapper by majkinetor"

      MsgBox 48, About, %msg%
   }

return


GuiClose:
   ExitApp
return


#include HiEdit.ahk

;sample includes
#include inc\Dlg.ahk
#include inc\Attach.ahk





:oops: Possibly/Normaly a demo here: http://soggos.free.fr/demo/?id=HiEditDropSelection.swf

_________________
with ahk, all is different!...<img>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2011, 7:24 pm 
Offline

Joined: January 29th, 2009, 9:50 pm
Posts: 483
Location: Belgium
is there a way to auto wrap text to the next line?

i want to use it to read e-books (txt)

and the wrap is the only thing i cant find in the docs.

thx for wrapping this control.

_________________
Stopwatch emdkplayer
the code i post falls under the: WTFYW-WTFPL license


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 240 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group