Extensions :  K-Meleon Forum
All about K-Meleon extensions. 
history sidebar (pseudo)
Posted by: disrupted
Date: September 15, 2009 06:15AM

http://kmext.sourceforge.net/tests/pseudoHSB.7z

repositions/resizes the history window according to km's parent window so as to appear as a sidebar. while pseudo is open you can maximize, resize or reposition km window and history window will always (follow) resize back according to km parent. the script also sets history window on top so km window doesn't overlap while using history.

the main advantages of this "extension" is you have history on top so you can check it or open sites from history without the need to reactivate its window when you click on km window and also there's a nice psychological feel about it

pseudo can be accessed from view>sidebars>pseudo history or from accel "ctrl alt H"





pseudo may not appear exactly in your kmeleon as in the snapshots because it's virtually impossible to find out in autoit which toolbars are displayed or whether the tabbar is at top or bottom position using ctrlid commands..also some may use 16pc skins other 24 etc so you might have a slight gap between history window and the statusbar or overlapping toolbars at the top.. you can edit the source to the best x, y, w, h positions for your kmeleon.. i'm also investigating how can the script position/resize if the macro got all the toolbar prefs needed from prefs and then passed them to the script as external commands that the script can parse and recalculate the coordinates accodingly.

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------pseudo history sidebar(exp.)------------------------------

$_tool_path=getfolder(RootFolder)."\\Tools";

pseudohsb{
plugin(history,View);
exec($_tool_path."\\pseudoHSB.exe ");
}

pseudohsb_BuildMenu{
setmenu("&View",popup,"Sidebars",1);
setmenu("Sidebars",macro,"History(pseudo)",pseudohsb);
}

pseudohsb_SetAccels{
setaccel("CTRL ALT H","macros(pseudohsb)");
}

$OnInit=$OnInit."pseudohsb_SetAccels;pseudohsb_BuildMenu;";
# ---------------------------------------------------------------------------
$macroModules=$macroModules."pseudohistorysidebar;";


; AutoIt Version: 3.3.0
; Language: English
; Platform: Win9x/NT
; Author: yannis
;pseudo history sidebar, repostitions, resizes history window according to km's window

#NoTrayIcon
#Include <Array.au3>
;#Include <WinAPI.au3>
;alt using winapi not utilised may or may not provide better handling
;ControlGetPos ( "title", "", "")
;$history="History"
;WinMove ( "title", "text", x, y [, width [, height[, speed]]] )
;$hWnd=WinGetHandle($history)
;_WinAPI_SetWindowPos($hWnd, "", 0, 0, 400, 700, "")

if WinExists("History") then
pseudoSB()
else
exit
endif
exit

Func pseudoSB()
While WinExists("History")
$kmwin=WinGetPos("[CLASS:KMeleon Browser Window]", "")
$getposx=_ArrayToString($kmwin, @TAB, 0, 4)
;MsgBox(0, "Active window stats (x,y,width,height):", $kmwin[0] & " " & $kmwin[1] & " " & $kmwin[2] & " " & $kmwin[3])
WinSetOnTop("History", "", 1)
WinMove("History", "", $kmwin[0]+5, $kmwin[1]+49, 220, $kmwin[3]-94)
sleep(444)
Wend
exit
EndFunc
exit




Edited 1 time(s). Last edit at 09/15/2009 06:19AM by disrupted.

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: disrupted
Date: September 15, 2009 07:05AM

update.. bugfox when closing kmeleon window while history window is open may produce an array subscript error

download from same link

; AutoIt Version: 3.3.0
; Language: English
; Platform: Win9x/NT
; Author: yannis
;pseudo history sidebar, repostitions, resizes history window according to km's window

#NoTrayIcon
#Include <Array.au3>
;#Include <WinAPI.au3>
;alt using winapi not utilised may or may not provide better handling
;ControlGetPos ( "title", "", "")
;$history="History"
;WinMove ( "title", "text", x, y [, width [, height[, speed]]] )
;$hWnd=WinGetHandle($history)
;_WinAPI_SetWindowPos($hWnd, "", 0, 0, 400, 700, "")

if WinExists("History") then
pseudoSB()
else
exit
endif
exit

Func pseudoSB()
While WinExists("History")
if winexists("[CLASS:KMeleon Browser Window]", "") then
$kmwin=WinGetPos("[CLASS:KMeleon Browser Window]", "")
$getposx=_ArrayToString($kmwin, @TAB, 0, 4)
;MsgBox(0, "Active window stats (x,y,width,height):", $kmwin[0] & " " & $kmwin[1] & " " & $kmwin[2] & " " & $kmwin[3])
WinSetOnTop("History", "", 1)
WinMove("History", "", $kmwin[0]+5, $kmwin[1]+49, 220, $kmwin[3]-94)
sleep(24)
else
exit
endif
Wend
exit
EndFunc
exit




Edited 1 time(s). Last edit at 09/15/2009 07:06AM by disrupted.

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: siria
Date: October 10, 2009 08:32PM

Hi, I just tested this a bit. The idea sure is good! But must admit, have some suggestions... ;-)
First, the default position is really VERY high, it's for one-line-browsers, but if that's really used by a majority of users...?
And had some trouble to get access to the options (sort by date or URL or show properties, when right-clicking in history). Finally realized it's visible when clicking at the utter right side of the history window, so not really a prob, but not quite evident, so there could be a hint somewhere in the description.
If the resizing and moving is adjustable at least in the kmm, that would be helpful, only it's difficult to figure out where exactly. Perhaps add variables somewhere near the top of the kmm?
And it makes sense to create a new sidebars menu, but additionally it should be accessible by a right-click on the history icon, for easier finding.
Last, why in the world do some macros have to have so unguessable names?? Never understood why, especially since in the preferences they are also only listed by name, without any hint of purpose except "(user-defined)". So to figure out what e.g. "dep" or "devtools" or "pseudoHSB" (in tools) might be for, it's necessary to go to the folder and open each file to check. That's one of the reasons why I'm so glad that there'll finally be an extensions-manager grinning smiley (Must admit haven't tried it yet at the moment, but will sure use it in the future, after deinstalling and recollecting my current extensions for new install, which needs real work and time UFF and so will take some time ;-)



Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: disrupted
Date: October 10, 2009 11:50PM

it's just an experimental thing.. the main reason i wrote it is not for the sidebar per se but i wanted history window to be on top while i'm opening pages from history, i didn't like that the kmeleon window would overlap and then i'd have to activate history again which is annoying when kmeleon is maximised or in fullscreen

when a true sidebar is implemented it won't be needed and to be able to have a 'proper' sidebar with pseudo the user will need to edit the source with the right coordinates for their kmeleon window and then compile..but that's not practical i guess, especially if you don't have autit to compile so i made an update which will make it easy for the user to change the position/height without compiling.. now there's an ini file pseudohsb.ini with 2 sections for height and y postion. it's preset to default kmeleon style(3 toolbars and tabbar at the top). you will just need to edit the values under height and postion in pseudohsb.ini with notepad to make it look right in your kmeleon. also now the script is not strict for english(history) but will work with all locales except for russian

download from same link
http://kmext.sourceforge.net/tests/pseudoHSB.7z

i have it set as default action for ctrl h and history button, to do that it's very easy

to make it default action for ctrl h,
in your kmeleon folder, browse to default\settings and open accel.cfg in notepad

look for this section
%ifplugin history
CTRL H = history(View)
%endif


and edit so it becomes:
%ifplugin history
CTRL H = macros(pseudohsb)
%endif

save the file and restart kmeleon

to make it default action for history button, open your skins folder and open the skin folder that you use, and find this file toolbars.cfg adn open it in notepad etc

%ifplugin history
History{
history(View)|Histor&y
View History. Right-click for more options.
toolhot.bmp[6]
toolcold.bmp[6]
tooldead.bmp[6]
}
%endif


edit so it becomes:
%ifplugin history
History{
macros(pseudohsb)
View History. Right-click for more options.
toolhot.bmp[6]
toolcold.bmp[6]
tooldead.bmp[6]
}
%endif


save and restart

update:
; AutoIt Version: 3.3.0
; Language: English
; Platform: Win9x/NT
; Author: yannis
;pseudo history sidebar, repostitions, resizes history window according to km's window

#NoTrayIcon
#Include <Array.au3>
;#Include <WinAPI.au3>
;alt using winapi not utilised may or may not provide better handling
;ControlGetPos ( "title", "", "")
;$history="History"
;WinMove ( "title", "text", x, y [, width [, height[, speed]]] )
;$hWnd=WinGetHandle($history)
;_WinAPI_SetWindowPos($hWnd, "", 0, 0, 400, 700, "")


$h=iniread(@scriptdir & "\pseudoHSB.ini", "height", 1, 94)
$y=iniread(@scriptdir & "\pseudoHSB.ini", "position", 1, 49)

if WinExists("Histor") then
pseudoSB()
elseif WinExists("Verlauf") then
pseudoSBde()
else
exit
endif
exit

Func pseudoSB()
While WinExists("Histor")
if winexists("[CLASS:KMeleon Browser Window]", "") then
$kmwin=WinGetPos("[CLASS:KMeleon Browser Window]", "")
$getposx=_ArrayToString($kmwin, @TAB, 0, 4)
;MsgBox(0, "Active window stats (x,y,width,height):", $kmwin[0] & " " & $kmwin[1] & " " & $kmwin[2] & " " & $kmwin[3])
WinSetOnTop("Histor", "", 1)
WinMove("Histor", "", $kmwin[0]+5, $kmwin[1]+$y, 220, $kmwin[3]-$h)
sleep(24)
else
exit
endif
Wend
exit
EndFunc
exit

Func pseudoSBde()
While WinExists("Verlauf")
if winexists("[CLASS:KMeleon Browser Window]", "") then
$kmwin=WinGetPos("[CLASS:KMeleon Browser Window]", "")
$getposx=_ArrayToString($kmwin, @TAB, 0, 4)
;MsgBox(0, "Active window stats (x,y,width,height):", $kmwin[0] & " " & $kmwin[1] & " " & $kmwin[2] & " " & $kmwin[3])
WinSetOnTop("Verlauf", "", 1)
WinMove("Verlauf", "", $kmwin[0]+5, $kmwin[1]+$y, 220, $kmwin[3]-$h)
sleep(24)
else
exit
endif
Wend
exit
EndFunc
exit


Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: siria
Date: October 11, 2009 03:07AM

Thank you... but don't find any ini confused smiley
And 7z still contains only files from 15 Sep?

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: disrupted
Date: October 11, 2009 03:27AM

you're downloading from your cache...so it's same file you've downloaded before. clear cache and it should download the new one

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: siria
Date: October 11, 2009 04:57PM

Oops... Uhm, download worked now Honestly, never had this prob before, always had the impression when I download a link it always takes the current files. But I did play with the cache settings awhile ago, and surfed a bit offline yesterday, oh well... Will have to remember that! So, learned something again smiling smiley
Anyway, the updatet function is still a bit weird, now the sidebar gives me the "normal" History function... Never mind, can live with it, switching back after clicking an entry with Alt+Tab isn't that bad really ;-)

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: disrupted
Date: October 12, 2009 12:40AM

that' weird.. make sure pseudoHSB.exe is in your tools folder and to make sure it's working.. open history and then open your task manager.. pseudohsb.exe should be listed there under processes.. odd, the older one worked with you?

if it still doesn't work..i'll upload older one with modified coordinates to work just right in your kmeleon window..your kmeleon looks exactly like in the snapshot above, right?

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: siria
Date: October 12, 2009 03:10AM

Actually, no pseudo in task manager, only "History"...
The old one worked, yes...
I suspect it's a win98 thing again, and just for curiosity clicked on pseudo exe in the tools folder directly, there pops up this error, not sure if its because of the wrong "opening" or perhaps a hint...
("dll not found", actually it's nowhere in KM-folder)


Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: disrupted
Date: October 12, 2009 04:28AM

no idea what that is.. maybe something script does not like? variables for different window names or iniread problem? have you tried the extensions manager on windows 98.. i would like to know how it works with locales in win9x.. i tested on mine but it's better to get more feedback on win98 because not many users

try this pseudo:
one for english:
http://kportal.clix5.com/siria/pseudoHSB-english.7z

one for german:
http://kportal.clix5.com/siria/pseudoHSB-german.7z
(these do not have macros or anything..just extract the exe directly in the tools folder and replace other pseudos

and download this macro, save it in macros folder
http://kportal.clix5.com/siria/kmextsearch.kmm

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: siria
Date: October 12, 2009 05:45AM

The new pseudos still don't work, sorry, and this DLL is obviously included in later win-versions, but wasn't in 98 yet. Never mind, not that important for me...

This Extensions-Search-macro is very nice, should IMO absolutely be included in future KM-versions! :-)

Haven't tried yet KEM, postponing yet a little, uhm, and it seems to be under heavy construction yet...? Perhaps next weekend, will see, got other stuff to finish first... And have I got this right, all it needs to work for existing macros too is copying the ini-file? :-)

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: disrupted
Date: October 12, 2009 07:14AM

it's strange that the first release worked and those last 2 didn't..they are identical..i think the problem is some kind ofa locked library in windows? try rebooting your pc..might work

pseudo sidebar is no longer an experiment as now it will auto resize and position on any kmeleon, regardless of toolbars number and whether the tabbar is at bottom or not..it will always calculate the exact coordinates for any kmeleon window look..you can even move your toolbars up and down normally and pseudo will reposition itself accordingly.. almost like a real sidebar

pseudo sidebar is available in 2 versions:
for all kmeleon languages-except for russian and german (en, pt, es, fr, pl)
http://kmext.sf.net/files/pseudohistory.7z

for german only (de)
http://kmext.sf.net/files/pseudohistory-DE.7z

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------pseudo history sidebar(exp.)------------------------------

$_tool_path=getfolder(RootFolder)."\\Tools";

pseudohsb{
$tabpos=getpref(BOOL,"kmeleon.tabs.bottomBar");
plugin(history,View);
exec($_tool_path."\\pseudoHSB " .$tabpos);
}

pseudohsb_BuildMenu{
setmenu("Sidebars",macro,"History(pseudo)",pseudohsb);
}

pseudohsb_SetAccels{
setaccel("CTRL ALT H","macros(pseudohsb)");
}

$OnInit=$OnInit."pseudohsb_SetAccels;pseudohsb_BuildMenu;";
# ---------------------------------------------------------------------------
$macroModules=$macroModules."pseudohistorysidebar;";



; AutoIt Version: 3.3.0
; Language: English
; Platform: Win9x/NT
; Author: yannis
;pseudo Histor sidebar, repostitions, resizes Histor window according to km's window

#NoTrayIcon
#Include <Array.au3>
#include <Misc.au3>

if _Singleton("pseudo",0) = 0 Then
exit
endif


if $CmdLine[1]=1 then
bottomtabs()
else
toptabs()
endif


func bottomtabs()
if WinExists("Histor") then
pseudoBOTTOM()
else
exit
endif
exit
endfunc

func toptabs()
if WinExists("Histor") then
pseudoTOP()
else
exit
endif
exit
endfunc

Func pseudoTOP()
While WinExists("Histor")
if winexists("[CLASS:KMeleon Browser Window]", "") then
$kmwin=WinGetPos("[CLASS:KMeleon Browser Window]", "")
$extra=ControlGetPos ("[CLASS:KMeleon Browser Window]", "", 59396 )
$tab=ControlGetPos ("[CLASS:KMeleon Browser Window]", "", 1080 )
$status=ControlGetPos ("[CLASS:KMeleon Browser Window]", "", 59393 )
;$getposx=_ArrayToString($kmwin, @TAB, 0, 4)
;MsgBox(0, "Active window stats (x,y,width,height):", $kmwin[0] & " " & $kmwin[1] & " " & $kmwin[2] & " " & $kmwin[3])
WinSetOnTop("Histor", "", 1)
WinMove("Histor", "", $kmwin[0]+5, $kmwin[1]+$extra[3]+$tab[3]+3, 220, $kmwin[3]-$extra[3]-$tab[3]-$status[3]-9)
sleep(24)
else
exit
endif
Wend
exit
EndFunc
exit

Func pseudoBOTTOM()
While WinExists("Histor")
if winexists("[CLASS:KMeleon Browser Window]", "") then
$kmwin=WinGetPos("[CLASS:KMeleon Browser Window]", "")
$extra=ControlGetPos ("[CLASS:KMeleon Browser Window]", "", 59396 )
$tab=ControlGetPos ("[CLASS:KMeleon Browser Window]", "", 1080 )
$status=ControlGetPos ("[CLASS:KMeleon Browser Window]", "", 59393 )
;$getposx=_ArrayToString($kmwin, @TAB, 0, 4)
;MsgBox(0, "Active window stats (x,y,width,height):", $kmwin[0] & " " & $kmwin[1] & " " & $kmwin[2] & " " & $kmwin[3])
WinSetOnTop("Histor", "", 1)
WinMove("Histor", "", $kmwin[0]+5, $kmwin[1]+$extra[3]+$tab[3]+3, 220, $kmwin[3]-$extra[3]-$tab[3]-$tab[3]-$status[3]-11)
sleep(24)
else
exit
endif
Wend
exit
EndFunc
exit


anyone interested in a pseudo bookmarks or favourites sidebar?

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: disrupted
Date: October 12, 2009 11:17PM

siria, i think i know what the problem might be.. the macro packaged had an error
exec($_tool_path."\\pseudoHSB " .$tabpos);

it was executing nothing.. it should've been
exec($_tool_path."\\pseudoHSB.EXE " .$tabpos);

sorry

the macro was fixed and uploaded, please redownload again if you qwant to test pseudo

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: siria
Date: October 13, 2009 12:36AM

*sigh* Thanks for all your trouble, but no, it works not. The really bad thing is, now I took a look at the versions of the two pseudoHSB.exe, and think I've got a heavy suspect:
The old one that works is version 3.2 of autoit.
The new one that does nothing except complain about missing userenv.dll in 98se, is version 3.3 of autoit.
Just great, that means the newer version of that autoit-thing doesn't work with win98 anymore, and that will surely affect lots of apps :-((

Btw, what I'd find really very useful is an additional menu entry in "Histor&y", for the existing history menu on the button ;-)

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: disrupted
Date: October 13, 2009 01:30AM

you are absolutely right..the version you were using lately was unicode compiled using autoit3.3.. the reason for this mixup is because i compile from the context menu instead of opening the compiler and directing to the file.. i have both 3.3.0 and 3.2.0 especially for compiling in ansi for universal extensions that run on all systems. 3.3.0 no longer supports ansi(only unicode and x64) and 3.2 was the last version to support ansi. recently i added a new context menu command for au3 files to instruct to use an icon which displays better on 9x systems.. except that instead of using the 3.2 compiler in that command; i selected the 3.3. compiler.. so what actually was meant to make the extension display with a better icon on 9x made a unicode binary that does not work on 9x.

you're very smart..and i would have probably never guessed this mixup, because even though i test on 9x, i always test using the source code directly with au3 and not as compiled..so it always worked on my 9x and then i'd go and compile on xp and didn't boot back in 9x to test the binary because since it worked as code, it will work as inary and because i was lazy- booting in 9x is kinda painful because i have it on a another drive with a boot sector not even seen by xp(i like to keep both oses apart without any one seeing the other incase a bootsector gets messed on one os it wouldn't affect the other os .. so i have to go into bios every time and change hard disk priority.

i've double checked all recent updates and extensions that might have been affected by this error.

supernanny 9x version was also unicode..fixed it and uploaded it
extensions manager 9x was also fixed and updated
and ofcourse the pseudo history sidebars..all have been recompiled in ansi and should work now.

i'm terribly sorry and very grateful for identifying this problem.. please redownload again and they should work.

edit: don;t worry about future extensions with 3.3.0.. any code that works on 3.3. will work on 3.2.. it was just a compiler problem.



Edited 1 time(s). Last edit at 10/13/2009 01:34AM by disrupted.

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: siria
Date: October 13, 2009 05:37AM

No reason to be sorry, I understand it's a very complicated job, programming, and additionally serving a bunch of horribly outdated operating systems sure doesnt make things easier. Not many people today care anymore about win98, so thanks go to you :-)
That I stumbled upon this autoit-prob was mostly just luck, glad it helped grinning smiley Basically clueless, just picking up a little here and there, always searching and comparing endlessly, and sometimes remembering snippets about "suspicious" things, like "autoit versions? wait, wasn't there something fishy about it somewhere recently...?" ;-)

Now guess what? IT WORKS....!! grinning smiley




That is, the english version did okay, the german first refused with some variables error, so the important thing is the current browser language (EN), not the system language (DE). After switching the browser to german, the german sidebar worked as well, even without a restart! :-)
The automatic height resizing works very nicely!! grinning smiley

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: disrupted
Date: October 14, 2009 06:24AM

the german is for german k-meleon(locale de) not system.
here's an extra tip, if you right click a history entry and uncheck properties.. that will remove the urlbar thing at the bottom and history will really look like a sidebar (nobody can tell the difference)

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: siria
Date: October 15, 2009 01:49AM

Quote
disrupted
and download this macro, save it in macros folder
http://kportal.clix5.com/siria/kmextsearch.kmm

Uhm, don't know where I had my eyes when I first tried it, but actually it always searches only for the term "kmext"

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: desga2
Date: October 15, 2009 02:37AM

The above code had a little bug, changes in bold:
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)


kmextsearcher{
$kmext = prompt("Enter search query:", "Search for Extensions", "extension name or function");
$kmext == "" ? "" : opentab("http: //www.google.com/search?hl=en&q=site:http ://kmext.sourceforge.net/%20" .$kmext);
}

open_web{
open("http ://kmext.sourceforge.net");
}

kmexters_BuildMenu{
setmenu("&Help",macro,"Extensions Centre",open_web,3);
setmenu("&Help",macro,"Search Extensions",kmextsearcher,2);
}

$OnInit=$OnInit."kmexters_BuildMenu;";
# --------------------------------------------------------------------
$macroModules=$macroModules."kmext-extra;";

K-Meleon in Spanish



Edited 1 time(s). Last edit at 10/15/2009 02:38AM by desga2.

Options: ReplyQuote
Re: history sidebar (pseudo)
Posted by: siria
Date: October 15, 2009 03:12AM

Uhm, thanx, but... now neither works any more....

Okay, I removed the blanks after the http, in both macros, now it's okay ;-)



Edited 2 time(s). Last edit at 10/15/2009 03:17AM by siria.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.