AutoHotkey Community

It is currently May 25th, 2012, 5:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 273 posts ]  Go to page Previous  1 ... 11, 12, 13, 14, 15, 16, 17 ... 19  Next
Author Message
 Post subject:
PostPosted: May 16th, 2007, 3:22 pm 
Hi Pastilhas,

I took a look at the code and your problem and have to admit this is a bug with the preview routine. I'll have to fix that. Sorry.

Even if the preview won't work for this, your BBCode is correct and should work when posted within a forum. But keep in mind that it's bandwidth theft if you reference images you don't host yourself.
___________________________
Cheers AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 16th, 2007, 3:27 pm 
@majkinetor

Quote:
... as you made entire script non-flexibile so it is hard to change it without looking at every peace of code bellow and above.

Well I always thought I documented the script very good, but this is apparently wrong. Do you have any ideas to make the script more flexible as you say?

BBCodeWriter is the result of my learning curve with AHK. When I started it I didn't knew anything about programming at all. So it can be that it's a little bit confusing or non-flexible.
__________________________
Cheers AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 16th, 2007, 10:54 pm 
Offline

Joined: February 12th, 2005, 8:31 pm
Posts: 82
Ok, made a small update (7.01) to fix the reported error within url tags.

Quote:
16.05.2007
+ fixed bug in BBCodePreview.ahk - BBCode tags within url tags weren't displayed (thx Pastilhas)

_________________
Cheers
BBCodeWriterToDo-ListCopyPassage


Report this post
Top
 Profile  
Reply with quote  
 Post subject: bug
PostPosted: May 18th, 2007, 4:07 pm 
Image

noticed this little bug while saving... Im on Win2K

see where the AUTO HIGHLIGHT goes???


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 18th, 2007, 4:11 pm 
Offline

Joined: June 29th, 2006, 9:37 am
Posts: 45
sorry I wasn't logged in

It only does the above if you have "Hide known Extensions" active

otherwise it works properly

maybe you could add some sort of If statement so if '.TXT' is detected it highlights only Posting

PS sorry I wasn't logged in last post, otherwise I would have edited


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 18th, 2007, 8:49 pm 
Offline

Joined: February 12th, 2005, 8:31 pm
Posts: 82
Hi cuzabis,

thx for reporting. I hopefully fixed it with version 7.0.2. Give it a try.

Quote:
18.05.2007
+ fixed bug in RenameHelper routine - wrong highlighting when 'Hide known extension' is active (thx cuzabis)

_________________
Cheers
BBCodeWriterToDo-ListCopyPassage


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 18th, 2007, 10:46 pm 
Offline

Joined: June 29th, 2006, 9:37 am
Posts: 45
Thanks man :) I will try it ;)

AND BTW

I really love the program :)

only thing I had a problem with is some forums use a different font sizing
and it doesn't have CENTER (im assuming because AHK.COM doesn't either)

do you maybe plan on implementing the [CENTER] ??

and how would one go about changing the font size... on the other forum Size=4 is Large (about the size of Size=20)
but that doesn't matter ;) the center thing would be great

FAST WORK BTW

EDIT.... tried it, and it works now ;) (the highlight)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 19th, 2007, 5:52 am 
Hi cuzabis,

Quote:
do you maybe plan on implementing the [CENTER] ??
Do you have the html output for a centered text within your forum? When you type
Quote:
[center]test[/center]
within your forum, what's the html output within the source code of the html page?

As for the center tag, BBCodeWriters preview routine just doesn't interpret these tags. But you could use one of the custom buttons in the second toolbar and customize it in the way that it pastes the center tag. In this way you could at least add them to your posting text. But remember, they won't work in the internal preview.


Quote:
and how would one go about changing the font size...
Well these sizes you're talking about seem to be no phpbb standard.

You could either use the edit control of the little "font size" gui and enter the number there, or you could take the source code of AHK BBCodeWriter, make your changes and compile another instance of BBCodeWriter for your special forum.

The font sizes for the 5 buttons within 'Font sizes' gui can be found in /phpbb/BBCodeEditor.ahk at line #70:
Code:
  ; Default Font sizes for Font Size GUI
  ListOfFontSizes = 7|9|12|18|24
  StringSplit, ArrayOfFontSizes, ListOfFontSizes, |

The five numbers within the 'ListOfFontSizes' variable are the five sizes used for the buttons within the font-sizes GUI.
__________________________
Cheers AGU a.k.a AGermanUser


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 20th, 2007, 9:23 am 
Offline

Joined: June 29th, 2006, 9:37 am
Posts: 45
thank you very much...

yeah I just use the custom for my [center] tag

and the html code for center is merely <center></center>

How about adding File---> New??

I think it would be a good idea... or even a clear (but there is the risk of accidently saving over your last save...
also can you tell me how I change the font size in preview? I have changed my font sizes from 7|10|12... to 1|4|5|6|7 (which displays the same size as 7|10|...) but in the AHK_PReview.ahk I can't seem to find which part of the html I have to change


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 3:55 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5346
Location: UK
Hi AGU,

I finally made that update to Anchor - you can now reset positions by calling the function with only the control variable as the first parameter. However since AutoHotkey has peculiar a behavior when referencing A_GuiWidth/Height outside of a Gui thread, an extra step is involved. One method like in my example is to evoke GuiSize by moving the Gui but another more elegant way would be to use a switch variable within the routine itself.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 6:30 pm 
@cuzabis
Quote:
How about adding File---> New??
I think it would be a good idea... or even a clear
That's why I added the 'reset' button in the lower right corner. It resets the titlebar as well as the edit control in order to create the next posting.
Pressing 'reset' even asks you if you're sure to clean the edit control.

I hope this is what you mean.


Quote:
also can you tell me how I change the font size in preview?


You can find it in phpbb/BBCodePreview.ahk. This is where the action takes place (at line #247)
Code:
  ; Convert FontSize formatting ################################################
  Loop, %MaxFontSize%
    {
      StringReplace, bbcode, bbcode, [size=%A_Index%]
      , <span style="font-size: %A_Index%px; line-height: normal">, All
    }
  StringReplace, bbcode, bbcode, [/size], </span>, All

The problem with your font sizes is, that they don't match the real html font sizes. So size=7 isn't the same as font-size:7px;. So the Loop won't work for you.

I think it would be best to replace it with StringReplace commands for every single font size. This means
Code:
StringReplace, bbcode, bbcode, [size=1]
      , <span style="font-size: *YourFontSize*px; line-height: normal">, All
StringReplace, bbcode, bbcode, [size=2]
      , <span style="font-size: *YourFontSize*px; line-height: normal">, All
...
StringReplace, bbcode, bbcode, [/size], </span>, All

You have to replace *YourFontSize* with the html font sizes that match the BBCode sizes. Another way would be to find some formula that converts your BBCode font sizes to HTML font sizes. Don't know if this is possible.

As for the center tag. If it's really that easy I think I'll add the code for the center tag to the next version of BBCodeWriter. :)
______________________
Cheers AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 6:44 pm 
Hi Titan,

I'll give it a try. :D

I tried all of your former PM'ed solutions for my problem. But none of them worked for me. So I made a dirty little workaround. I wonder if you already have seen it. ;)

I changed back to v. 3.4.2 and added this little passage

Code:
Anchor(In_CtrlVar, In_Anchor, Draw = false)
  {
    ; Thanks to Titan for this function (v3.4.2)
    ; Details under http://www.autohotkey.com/forum/topic4348.html
   
    ; In_CtrlVar  : Controls associated variable (e.g. "MyEdit")
    ; In_Anchor   : Anchors (x, y, w, h)
    ; Draw        : true/1 to use MoveDraw otherwise leave blank for a normal Move 
 
    ; store control positions and sizes in an internally parsable table-like format
    static DataTbl
    global ResetAnchor, DataTblCtrlList
     
     If ResetAnchor
      {
        DataTbl =
        StringSplit, CtrlListArray, DataTblCtrlList, `n

        ; Loop 12 times because of twelve controls in GuiSize label
        Loop, %CtrlListArray0%
          {
            StringSplit, CtrlEntryArray, CtrlListArray%A_Index%, `,
           
            GuiControlGet, CtrlPS, Pos, %CtrlEntryArray1%
            Signtre = `n%A_Gui%:%CtrlEntryArray1%
            PrsHlp = x.w.y.h./.7.%A_GuiWidth%.%A_GuiHeight%
            StringSplit, PrsHlp, PrsHlp, .
           
            Loop, 4
              RelFact%A_Index% += !RegExMatch(CtrlEntryArray2, PrsHlp%A_Index% . "(?P<" . A_Index . ">[\d.]+)", RelFact)

            If !InStr(DataTbl, Signtre)
              DataTbl := DataTbl . Signtre . CtrlPSX - PrsHlp7 * RelFact1 . PrsHlp5 . CtrlPSW - PrsHlp7 * RelFact2
                      .  PrsHlp5 . CtrlPSY - PrsHlp8 * RelFact3 . PrsHlp5 . CtrlPSH - PrsHlp8 * RelFact4 . PrsHlp5                         
          }
       
        ResetAnchor := false
      }

       
     
    ; Retrieve control's size and position
    GuiControlGet, CtrlPS, Pos, %In_CtrlVar%
    ; If control doesn't exist or this thread isn't called by a GUI event...
    If !A_Gui or ErrorLevel
      Return

    ; Create identifier for the control in the current window
    Signtre = `n%A_Gui%:%In_CtrlVar%
    ; Period-delimited variable for parsing support
    PrsHlp = x.w.y.h./.7.%A_GuiWidth%.%A_GuiHeight%
    StringSplit, PrsHlp, PrsHlp, .
     
    ; Retrieve relative factors by RegEx and store them into "RelFact" array
    Loop, 4
      RelFact%A_Index% += !RegExMatch(In_Anchor, PrsHlp%A_Index% . "(?P<" . A_Index . ">[\d.]+)", RelFact)

    ; If current signature is not found in the data table, concatenate each value
    ; subtracted by the gui width for x/w or height for y/h and multiplied by it's factor.
    If !InStr(DataTbl, Signtre)
      DataTbl := DataTbl . Signtre . CtrlPSX - PrsHlp7 * RelFact1 . PrsHlp5 . CtrlPSW - PrsHlp7 * RelFact2
              .  PrsHlp5 . CtrlPSY - PrsHlp8 * RelFact3 . PrsHlp5 . CtrlPSH - PrsHlp8 * RelFact4 . PrsHlp5

    ; For each of the four possible anchors (again):
    Loop, 4
      If InStr(In_Anchor, PrsHlp%A_Index%)
        {
          ; Alias for the Loop index
          LoopIdx = %A_Index%
          ; For x/w, PrsHlp6 equals to the GUI width, otherwise height
           PrsHlp6 += !cx AND (cx := LoopIdx > 2)
          ; This regular expression assigns the variable CtrlPS1 to the absolute dimension
          ; stored in the data table:
           RegExMatch(DataTbl, Signtre . "(?:(-?[\d.]+)/){" . LoopIdx . "}", CtrlPS)
          ; Concatenate the new value and it's anchor to the variable 'NewVal':
           NewVal := NewVal . PrsHlp%LoopIdx% . CtrlPS1 + PrsHlp%PrsHlp6% * RelFact%LoopIdx%
        }
    ; If Draw is true use GuiControl, MoveDraw instead of normal GuiControl, Move
    If Draw
      GCtrlMv = Draw
    ; Update the positions of the control
    GuiControl, Move%GCtrlMv%, %In_CtrlVar%, %NewVal%
  }


CtrlListArray is listed in BBCodeEditor.ahk and contains:
Code:
  ; List of Gui controls of MainGUI to rebuild DataTbl within Anchor function -> functions.ahk
  DataTblCtrlList =
    (Ltrim
      EdtComment,wh
      GrpMenuBorder,w
      GrpCstmBorder,w
      BtnCustomize,x
      ChkSig,y
      DDLSig,y
      BtnEditSig,y
      BtnDelSig,y
      BtnSend,xy
      BtnPreview,xy
      BtnReset,xy
      BtnPinned,x
    )


When I want to reset positions I switch the 'ResetAnchor' variable to 'true' and Anchor rereads the complete 'DataTbl' variable. I wonder what you think about it. ;)
______________________
Cheers AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 7:09 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5346
Location: UK
I downloaded the latest copy of your source code but I think you removed the button to collapse/expand the 'customize' toolbar. If you put this back, toggling the Edit's height should be as simple as:

Code:
GuiSize:
save_height := A_GuiHeight
; ...

BtnToggle: ; or whatever your label is called
GuiControlGet, p, Pos, EdtComment
If toolbar_collapsed
   ph -= 30 ; toolbar is currently collapsed so expand and make room by shortening the Edit height
Else ph += 30 ; otherwise do the opposite
; toolbar_collapsed := !toolbar_collapsed ; toggle var if you need to
GuiControl, Move, EdtComment, h%ph%
Anchor("EdtComment") ; clear cache
save_height++
Gui, Show, h%save_height% ; call GuiSize by changing Gui Size
Return


I realize that changing the Gui size is not a great method but it has to be done due to the internal limitations of AutoHotkey. If your specialized version of Anchor works then you might as well keep on using that.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 7:17 pm 
Quote:
but I think you removed the button to collapse/expand the 'customize' toolbar.
Oops. Yeah I forgot to mention. As I couldn't find a working solution for this expand/collapse button I tried another approach.

Now the second toolbar can be activated/deactivated via preferences. Funny thing is, after making all the changes to get this new solution to work I thought I may have found a way in which my first approach might work now too.
I have to admit that I was too lazy to give it another try in the end. I wanted to release the version as I made some other bug fixes.

But I'll give it another try with your new function. :D
_____________________
Cheers AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 28th, 2007, 6:30 pm 
Offline

Joined: June 29th, 2006, 9:37 am
Posts: 45
Thanks AGU :) I will try it

*EDIT*
so I attempted a change:
Code:
   ; Convert FontSize formatting ################################################

; Trial different forum sizing!

Loop, %MaxFontSize%
{

StringReplace, bbcode, bbcode, [size=1]
      , <span style="font-size:8pt; line-height: normal">, All

StringReplace, bbcode, bbcode, [size=2]
      , <span style="font-size:10pt; line-height: normal">, All

StringReplace, bbcode, bbcode, [size=3]
      , <span style="font-size:12pt; line-height: normal">, All

StringReplace, bbcode, bbcode, [size=4]
      , <span style="font-size:14pt; line-height: normal">, All

StringReplace, bbcode, bbcode, [size=5]
      , <span style="font-size:18pt; line-height: normal">, All

StringReplace, bbcode, bbcode, [size=6]
      , <span style="font-size:24pt; line-height: normal">, All

StringReplace, bbcode, bbcode, [size=7]
      , <span style="font-size:36pt; line-height: normal">, All
}
  StringReplace, bbcode, bbcode, [/size], </span>, All


I Got it working, now I am working on the CENTER ;)

**EDIT**
got CENTER too

Code:
  ; Convert CENTER Formatting
  StringReplace, bbcode, bbcode, [center], <center>, All
  StringReplace, bbcode, bbcode, [/center], </center>, All


it was that easy ;)

thanks again AGU (A German User) you are da bomb.... I seen there is another BBCODE editor out (not AHK) but I have to say, yours is much nicer ;)


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 ... 11, 12, 13, 14, 15, 16, 17 ... 19  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Yahoo [Bot], ZeLen1y and 11 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