AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 273 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 19  Next
Author Message
 Post subject:
PostPosted: November 13th, 2005, 4:41 pm 
Offline

Joined: February 12th, 2005, 8:31 pm
Posts: 82
toralf wrote:
Code:
SetBBCodeTags("[b]","[/b]", BoldPressed)

Oh man, I'm so stupid. Image
thx toralf. Didn't see the mistake despite looking over this passage a hundred times.

Made another update where I added your code simplification.

Added also a "hidden" credits gui. ;) Tell me what you think about it, in case you find it. :lol:
It's not too hard to find it. :mrgreen:

_________________
Cheers
BBCodeWriterToDo-ListCopyPassage


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2005, 6:35 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Another feature could be an automatic popup for your BBCodeWriter, e.g.
Code:
SetTitleMatchMode, 2
SetTimer, PostingReplyCheck
;...
Return

PostingReplyCheck:
IfWinExist, Post a reply - Microsoft Internet Explorer
   Gui, Show
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2005, 12:37 am 
I'm not sure if I understand what you mean. Does your code mean that the BBCodeWriter window get activated if it looses focus after pressing "Preview"?

That's the reason why I added this "Pin" button on the upper right corner. It makes the main window of BBCodeWriter "AlwaysOnTop". Therefore the browser window can't hide it.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2005, 2:04 am 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Thats the thing, instead of the window being always on top or having to manually activate the window when you need it, it would be a good addition if the window automatically popped up when it detected that a forum was being used (e.g. by IfWinExist, Post a reply).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2005, 4:53 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Another useful option would be automatic url reference to ahk command names. Run the following script to get a list of hotstrings:

Code:
RegRead, inst, HKLM, SOFTWARE\AutoHotkey, InstallDir
dest = %temp%\AHK-docref.txt
FileDelete, %dest%

FileRead, f, %inst%\Extras\Editors\Syntax\CommandNames.txt
StringReplace, f, f, `r, , 1
Loop, Parse, f, `n
   If A_LoopField
      FileAppend, :*:%A_LoopField%`::[url=http://www.autohotkey.com/docs/commands/%A_LoopField%.htm]%A_LoopField%[/url]`r`n, %dest%
Run, notepad %dest%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2005, 1:49 am 
Sorry for my late answer. :oops:

After readling your lines again I finally understood what you meant with that "automatic popup" feature. You mean BBCodeWriter is running all the time, and when a user tries to post a message or create a new thread, BBCodeWriter should popup to let the user write his posting, right?

Hmm, does it affect system performance when the script is running all the time with the timer checking for a new browser window?
Does the window title always contain "Post a reply - ..." in a standard installation of phpbb? And since BBCodeWriter has no tray icon how would you hide the BBCodeWriter window so that it's not bothering the user. I know some users that get bothered by minimized windows in the taskbar. Or should there be a tray icon?
And what about other languages e.g. german? A german forum won't have "Post a reply -" in the window title , will it? How would you solve that language issue?

Apart from this it's a great idea. I'm thinking about making the "window title recognition" in some way configurable. Any idea? There's plenty of room in the "Preferences" Gui. ;) :mrgreen:


Concerning "automatic url reference": That would be a very special thing for AHK users. How do you think this should work? A user enters an AHK command and it is converted to an url linking to the website of that command?
I think AHK commands are mainly noted inside the code tags. But inside code tags URLs don't work. I checked that. So how would you use this feature? Tell me more :mrgreen:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2006, 4:15 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Great script! I was looking for some code to ease inputing BBCode in these little textareas, since stupid phpBB script always append the codes at the end of the area instead of inserting them where the caret is.
Your program is even better! I like the preview.
And this is an impressive example of GUI by AHK.

I wanted to test with a post I was writting, and the preview was awful, with font becoming suddently big and overlaid.

I found it was because I wrote some raw HTML codes: "<p> ends when meeting <h1>, <ul>".

So I added three lines before the bold formatting:
Code:
  ; Convert HTML sensitive chars ###############################################
  StringReplace, bbcode, bbcode, &, &amp`;, All
  StringReplace, bbcode, bbcode, <, &lt`;, All
  StringReplace, bbcode, bbcode, >, &gt`;, All


I also added a `n after <br> so view source is nicer.

I might prefer to insert starting and ending tag at once, and put the caret between. I will see that.
Also I can exit after doing changes, perhaps it should ask to save before, if possible. Not if text has been changed or copied with the button.

Excellent work!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2006, 12:31 pm 
Thx for your nice compliments. :D
Quote:
So I added three lines before the bold formatting:

Makes sense. I'll add these in a next version 5.6

Quote:
I also added a `n after <br> so view source is nicer
I consider adding these too. I just have to check in different browsers if empty lines within HTML code affect the correct displaying of the preview page.

Quote:
I might prefer to insert starting and ending tag at once, and put the caret between.
Hmm, I see what you mean. That's rather hard to add within the script. But of course you can edit the source ahk files to accompolish this.
Just have a look at the "SetBBCodeTags" function. You just have to replace
Code:
        If (In_BtnVariable = 0)
          {
            In_BtnVariable++
            Return, %In_StartTag%
          }
        If (In_BtnVariable = 1)
          {
            In_BtnVariable--
            Return, %In_EndTag%

to s.th that fits your needs. E.g.

Code:
        Return, %In_StartTag%%In_EndTag%

Of course you have to do a StringLen on the In_EndTag to get the number of characters because the length can vary between the different tags.
In the end just Send, {Left %LengthOfEndTag%} and you're done I think.

Quote:
Also I can exit after doing changes, perhaps it should ask to save before, if possible.
Good idea. I'll think about it and will have a look how to accomplish this. :D

Cheers
AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2006, 10:00 pm 
Offline

Joined: February 12th, 2005, 8:31 pm
Posts: 82
So, after some hours of work I added all your proposed features. :mrgreen:

I changed the entering of BBcode Tags to your proposed system (pasting both tags and moving caret) cause I found it much better than before. In this way I can do it without all this xxxxPressed variables.

Further details can be found in the updated first posting.

Cheers
AGermanUser a.k.a AGU

EDIT
btw:
I'm still looking for a better icon instead of this little smiley in the title bar. I made this smiley in a rush. I'm looking for a better icon that looks good at 16x16pixel as well as with 32x32pixel and goes in line with AHK BBcodeWriter. Any suggestions?

_________________
Cheers
BBCodeWriterToDo-ListCopyPassage


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2006, 12:53 am 
This is one of the best and most useful AHK scripts I've seen. Thanks very much for sharing it and updating it!

I have run into one problem though. Html and xml statements within bbcode's code tags do not display properly when previewed. I presume that the '<' characters are the culprit. It has not been a hinderance but it would be nice if that worked properly. Maybe this could go onto the list of improvements for a future version.

Thanks once again.

brian32


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2006, 12:20 pm 
Offline

Joined: February 12th, 2005, 8:31 pm
Posts: 82
thx brian32. :D
Quote:
I have run into one problem though. Html and xml statements within bbcode's code tags do not display properly when previewed. I presume that the '<' characters are the culprit.
I updated the script to version 5.6.1 and hopefully fixed that issue. See updated first posting.

Could you give it one more try and report back if it's okay now? Maybe there are more HTML/XML sensitive chars that need to be taken care of.

_________________
Cheers
BBCodeWriterToDo-ListCopyPassage


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2006, 3:35 pm 
AGU that was a fast response! It looks like it is working fine now previewing XML and HTML code.

Thanks again for a great script.
brian32


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2006, 5:11 pm 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
hi,

when i try to run the script i get and error on line 125 " call to non existent function"

btw the directoy of the icons is the root dir not in phpbb if that makes any differnce.

iam trying to learn how to make buttons with graphics :)

i have found the graphic buttons script from corrupt

but i really wanna use that editor :D

thanks
Twhyman


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2006, 8:39 pm 
Hello, twhyman

I think you tried to run "BBCodeEditor.ahk". But this is wrong. As the instruction in the first posting states out:
Quote:
Simply extract the zip file to a folder and run "main.ahk".

You just have to extract the downloaded zip file to a directory of your choice and run "main.ahk" inside of this directory.

main.ahk includes all files with the help of the #Include directive. It includes for example the "functions.ahk" which holds the function used inside BBCodeEditor.ahk.
So when you run BBCodeEditor.ahk on its own it can't find that function and reports the error "Call to non existent function"

btw. when you extract the zip file you have to tell your zip program to obey the included paths within the zip file. Normally you won't have to pay attention to this. Your zip program should do that automatically. I wrote it just in case you're still having problems after this posting.

The directory has to look like this after unzipping:

Code:
Your folder
  + phpbb
    + ico             (icons for main gui)
      + smileys       (icons for smiley gui)
    + images          (images for html preview page)
    + smileys         (smiley images for preview page)
      BBCodeEditor.ahk
      BBCodePreview.ahk
      color.gif
      style.css
  + postings          (folder will be created at first script start)
  + text              (text files for help menu in menu bar - main gui)
    BBCodeWriter.ini  (config file - holds displayed number of lines in main.gui)
    functions.ahk     (used functions)
    hotkeys.ahk       (used hotkeys)
    main.ahk          (this is the start script - this has to be executed to run BBCodeWriter)
    preview.html      (file will be created when pushing "preview" button within main gui)


Hope that helps :mrgreen:

Cheers
AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2006, 7:08 pm 
Offline

Joined: October 10th, 2005, 10:44 am
Posts: 299
Location: Germany
Wow, pretty elaborate work there - thanks for sharing!

Just a minor suggestion to avoid losing the clipboard content (this might have come up already, I haven't read all replies here):
Code:
OnExit, quit

clipboardOld := clipboard ; backup clipboard contents (using ClipboardAll here might result in excessive memory use)
clipboard = ; flush clipboard

[...]

quit:
   clipboard := clipboardOld ; restore clipboard contents
   ExitApp
Return
(I just noticed there's an example in the documentation that's pretty much exactly the same as my suggestion here - d'oh!)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 273 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 19  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo and 24 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