1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | ' Gambas class file PUBLIC UrklippVSString AS Variant PUBLIC bRam AS Boolean PUBLIC SUB Form_Open() bRam = TRUE textDatumTid_vs.Text = CStr(Format(Now(), "yymmdd")) & "_" & CStr(Format(Now(), "hhmmss")) ' Tiden visades lite knasigt? Typ 40 min för lite? rbVisaMer_Click textRubrik_vs_Change END PUBLIC SUB textRubrik_vs_Change() IF rbVisaMer.Value THEN theString("[Visa mer...]") END IF IF rbVisaEXIF.Value THEN theString("[Visa EXIF:]") END IF END PUBLIC SUB knappTillUrklipp_Click() Clipboard.Copy(UrklippVSString) textDatumTid_vs.Text = CStr(Format(Now(), "yymmdd")) & "_" & CStr(Format(Now(), "hhmmss")) END PUBLIC SUB Form_Resize() textBefore_vs.Resize(ME.ClientW - 110, textBefore_vs.h) textSkyl_vs.Resize(ME.ClientW - 110, ME.H - (Panel1.H + 170)) Panel1.Resize(ME.ClientW, Panel1.h) Panel1.Top = (ME.H - Panel1.H) - 15 textAfterText_vs.Resize(ME.ClientW - 110, textAfterText_vs.h) knappTillUrklipp.Left = (ME.W - knappTillUrklipp.W) - 15 END PUBLIC SUB textDatumTid_vs_Change() IF rbVisaMer.Value THEN theString("[Visa mer...]") END IF IF rbVisaEXIF.Value THEN theString("[Visa EXIF:]") END IF END PUBLIC SUB textSkyl_vs_Change() textSkyl_vs.Refresh UrklippVSString = Conv(textBefore_vs.text & textSkyl_vs.text & textAfterText_vs.text, "utf-8", "Latin1") END PUBLIC SUB rbVisaMer_Click() IF rbVisaMer.Value THEN theString("[Visa mer...]") END IF IF rbVisaEXIF.Value THEN theString("[Visa EXIF:]") END IF END PUBLIC SUB rbVisaEXIF_Click() IF rbVisaMer.Value THEN theString("[Visa mer...]") END IF IF rbVisaEXIF.Value THEN theString("[Visa EXIF:]") END IF END PUBLIC SUB theString(sVisa AS String) textBefore_vs.text = "<a id=" & Chr(34)& textRubrik_vs.text & Chr(34)& " style=" & Chr(34)& "background-color: #ffffcc; cursor: pointer" & Chr(34)& " onclick=" & Chr(34)& "expand(this.id+'" & "_" & textDatumTid_vs.text & "', this);" & Chr(34)& ">" & sVisa & "</a><div id=" & Chr(34)& textRubrik_vs.text & "_" & textDatumTid_vs.text & Chr(34)& " style=" & Chr(34)& IIf(bRam, "border: 1px solid grey; display: none", "display: none")& Chr(34)& "><p>" textAfterText_vs.text = "</p></div><!-- Slut " & textRubrik_vs.text & " -->" UrklippVSString = Conv(textBefore_vs.text & textSkyl_vs.text & textAfterText_vs.text, "utf-8", "Latin1") END PUBLIC SUB cbRam_Click() IF bRam THEN bRam = FALSE ELSE bRam = TRUE END IF rbVisaMer_Click END |
This post is here because the WP-CodeBox code writer, Erik Wang, could be able to read it and help my out. I have post a comment on his blog post: WP-CODEBOX Plugin
Note[090114 UTC 17:33]: I found some useful information on the blog post:
‘Styling code samples par deux‘. I’m now on the right way. It feel like that.
But the code syntax highlighting is a little bit less or it could be some more colours.
The lines 83 to 85 is misleading. There is no comments (green). It is string code.
But, this is not real vb-code. It is gambas. So I have to live with some small misleading colours
One more thing: Can I find a way to set the ‘box’ to a max height?
Note[090114 UTC 17:43]: Another irritating thing that is not depending on the PlugIn WP-CodeBox is that I have to paste the code from scratch every time I update this post.
Is there a way to get rid of this annoying fact?
Note[090114 UTC 20:42]: Ok, I solve the main problem. The code syntax is highlighted in a box.
And I solve the issue with to height box. I now have a box that is about 200 pix height.
How do I do that? I search at the internet an found a blog page:
Insérer du code dans un article, and yes it is in French.
And that post guide me to edit a file (two files):
/blogg/wp-conten/plugins/wp-codebox/main.php
is the first one. And in that one I change the row number 130 from:
130 | $output .= "<div class=\"wp_codebox\">"; |
to:
130 | $output .= "<div style=\"display: block;\" class=\"wp_codebox\">"; |
And after that i change the second file:
/blogg/wp-conten/plugins/wp-codebox/css/codebox.css
In that file I change the row number 72 in the following part of the code:
69 70 71 72 73 74 75 | /* IE FIX */ .wp_codebox { overflow-x: auto; overflow-y: hidden; padding-bottom: expression(this.scrollWidth > this.offsetWidth ? 15 : 0); width: 100%; } |
from:
72 | overflow-y: hidden; |
to:
72 | overflow-y: auto; |
And in the code part above this I add a row in the following part of code:
60 61 62 63 64 65 66 67 | /* codebox */ .wp_codebox { color: #100; background-color: #f9f9f9; border: 1px solid silver; margin: 0 0 1.5em 0; overflow: auto; } |
Below the row ‘overflow: auto;‘ at row number 67 I add this line:
67 | max-height: 200px |
So, the code snippet now looks like this:
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | /* codebox */ .wp_codebox { color: #100; background-color: #f9f9f9; border: 1px solid silver; margin: 0 0 1.5em 0; overflow: auto; max-height: 200px } /* IE FIX */ .wp_codebox { overflow-x: auto; overflow-y: auto; padding-bottom: expression(this.scrollWidth > this.offsetWidth ? 15 : 0); width: 100%; } |
I feel pretty good.
I feel enough strong to see if I can solve the problem with character that change from ‘&’ to ‘&’ and ‘>’ to ‘>’ for some example.
And, why not, translate the PlugIn WP-CodeBox to Swedish?
.jpg)


![Validate my RSS feed [Valid RSS]](/images/valid-rss.png)


![[Bild: Google Analytics]](http://blogg.ngn.nu/images/Google-Analytics.gif)

Det var rackarns jag fick maxhöjden fixad. Och det tack vare en fransman via det här blogginlägget:
Insérer du code dans un article (http://www.duretz.net/2008/10/29/inserer-du-code-dans-un-article/)
Nu kanske jag kan ge mig på det irriterande faktum att WordPress admin textredigerare per standard ändra ‘mysko’ kod – när jag inte vill att den ska bli ändrad.
[Kommentera]
Jag gav mig INTE på: ”… det irriterande faktum att WordPress admin textredigerare per standard ändrar ‘mysko’ kod – när jag inte vill att den ska bli ändrad.”
Jag roade mig i stället med att översätta den till svenska.
Men den mesta översättningen hamnade ju på den s.k. admin-sidan och där är det ju bara jag som läser.
[Kommentera]