Page 2 of 3

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 07 Mar 2014, 15:02
by ahk7
So you like color as well :-)
If I .prepend or .log an array nothing happens (with .log it prints the date line).
Is it done on purpose these can't display arrays?

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 07 Mar 2014, 15:44
by AfterLemon
Actually it should be printing the array. I will look at it as soon as possible. Will update this post when I know more.

This works for me:

Code: Select all

a:=Class_Console("a",100,100,800,500)
array:=[1,2,3,4,5,[1,2,3,4,5],7,8,[1,[1,2],2],10]
a.append(array)
array:={"a":1,"b":2,"c":3,"d":4,"e":5,"f":{"fa":1,"fb":2,"fc":3,"fd":4,"fe":5},"g":7,"h":8,"i":{"ia":1,"ib":{"iba":1,"ibb":2},"ic":3},"j":10}
a.append(array)
a.show()
return
Can you give me an example of an array that does NOT work for you?

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 07 Mar 2014, 16:14
by ahk7
if I have this

Code: Select all

a:=new console("a",100,100,800,400)
a.append("text")
a.show()
return
typing help shows the help but if I have this

Code: Select all

a:=new console("ab",100,100,800,400)
a.append("text")
a.show()
return
typing help shows nothing.
Is the Name parameter of the new console limited to 1 character?

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 07 Mar 2014, 17:33
by AfterLemon
The name parameter (for the purpose of the GUI Command Bar) must match the name of the object in which it resides.
See here:

Code: Select all

ab:=new console("ab",100,100,800,400)
ab.append("text")
ab.show()
return
This is detailed in the newest documentation, but I am looking in to how to relieve this strange behavior.
This behavior is caused by the "this" reference to be referring to the object named in ab:=, while the handling of the Gui input is using %Gui%. %Gui% contains the name that is supplied as the first parameter. Thus our "this" and our "Gui" technically have different names. The "name" parameter is essentially a literal 'pointer' to the name of the object as it is now. We've been working towards getting a GetObjHost() function or something of the sort.

We'll see if, once again, we can make history with the abuse this thing is doling out to AHK and tidbit and I.

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 07 Mar 2014, 17:38
by ahk7
.append works but .log and .prepend don't see

Code: Select all

array:={a:"b",c: {d:"e",f:"g"},h:"i"}

a:=new console("a",100,100,800,400)
a.show()
a.append("appending some text") ; works
a.log("logging some text") ; works
a.append(array) ; works
sleep 500
a.append("appending some text") ; works
a.log(array) ; doesn't work
sleep 500
a.prepend("prepending some text") ; works
sleep 500
a.prepend(array) ; doesn't work
return
Esc::
    critical
    exitapp
return

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 07 Mar 2014, 18:35
by joedf
AfterLemon is right...
how i see it :
-> [Class] Console is a simple practical way used for debugging scripts.
-> LibCon Is actually a "wrapper" / support for an actual console, like autoIt has, but that autohotkey lacks. it was not made with debugging in mind.
it fails to start due to VarSetCapacity not implemented
where is the bug? i ll fix it... because it seems to work fine... :P thx

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 11 Mar 2014, 17:16
by AfterLemon
New Update! V1.8 Available

Features:
[Class] Console can now be used as an #Include or as a Lib. (using Class_Console())

Methods/Commands:
No new methods/commands.

Fixes:
.pull() is working correctly
Specifying the object name as "Name" parameter allows CommandBar to function correctly.
Documentation is fixed/updated for Help, Desc, Methods, About

Current Status:
All known bugs are squashed

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 12 Mar 2014, 14:56
by ahk7
Have you tested the demo scripts? None of them work for me with after the new update, my old test scripts no longer work either. The consoles are never visible. 64bit, v1.1.14.03.

Edit: yes of course I did #include :-) In demo2 I get an error "illegal char in variable list" as well... very odd.

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 12 Mar 2014, 14:59
by joedf
Oh yeah for me too... Just a #include in the files... It will work then.

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 12 Mar 2014, 16:32
by AfterLemon
Sorry, I hadn't updated the demo scripts since there is one included in the file, but I'll check them and modify them as well.

GitHub was being rude yesterday and not really letting me edit anything until 10 minutes before I had to go.

Updated Demos
They're fixed!

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 12 Mar 2014, 16:33
by joedf
wow... :O

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 12 Mar 2014, 16:41
by AfterLemon
Demos are updated and working. We hadn't used them, instead including the demo in the file.

Run the file standalone for a few examples and a testbed.

Also work as an #Include and Lib still. Sorry for the problem!

When defining a new console, do not use Var:=new console(name) unless calling it from an #Include or specifically included.
The "Name" parameter is the internal name for the Gui/Object, assigning it returns 1 on completion. Var:=Class_Console(Name,x,y,w,h) returns Var=1
The "Name" parameter creates a global object to be used to call the methods. Name.Show(), while parameter 6, GuiTitle, specifies the name of the Gui ("Console %GuiTitle%" essentially).

These changes are documented in the Class_Console Documentation file on GitHub.

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 12 Mar 2014, 16:46
by ahk7
Works now, looks good.

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 12 Mar 2014, 16:50
by AfterLemon
Useful CommandBar commands to check the script functionality are Help, About, Desc, Methods.

They all use color, css formatting, and describe the script and give some helpful information.

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 12 Mar 2014, 16:57
by joedf
AfterLemon wrote:(Not much experience with LibCon, it fails to start due to VarSetCapacity not implemented)
wheres the bug? tell me, so i can fix it.. :O

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 12 Mar 2014, 17:08
by AfterLemon
joedf wrote:
AfterLemon wrote:(Not much experience with LibCon, it fails to start due to VarSetCapacity not implemented)
wheres the bug? tell me, so i can fix it.. :O
Hey, try not to offtopic the thread. :]

It wasn't working at first, it is now. Idk what happened before.

I had probably tried to use it as a Lib (the name LibCon is misleading) or include it specifically in the example code.

EDIT: It is because I included it in the example code instead of #Include.

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 14 Mar 2014, 17:02
by ahk7
bug #1:

Code: Select all

array:={a:"b"}
Class_Console("a",100,100,800,400)
a.show()
a.append(array) ; only shows arr["a"]= instead of arr["a"]=b
Return
bug #2:

Code: Select all

array:={a:"b",c: {d:"e",f:"g"},h:"i"}
Class_Console("a",100,100,800,400)
a.show()
loop 10
	a.prepend("prepending some text") 
sleep 1500
a.prepend(array)
return
Notice the incorrect indentation of the following lines, they have one space to many between line number and the text:

11. prepending some text
12. prepending some text
13. prepending some text
14. prepending some text

(Yes, using the latest version which you've just updated on GH)

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 14 Mar 2014, 17:14
by AfterLemon
Thanks for not badgering me about updating on GH and not posting anything about it. :]

Will get working on a fix for the second one hopefully before the next 2 hours are up.

The first issue MIGHT be very simple, and I'll look into it, but can't promise a fix today.

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 14 Mar 2014, 19:11
by AfterLemon
Both issues are fixed!

Re: [Class] Console - Standardized Console GUI with Methods

Posted: 15 Mar 2014, 03:57
by Sjc1000
Nice use of MSHTML guys. Top script. :D

EDIT:

Just noticed something, you guys didn't disable the right click on the html.
If you don't want the right click menu change your html body to

<body id="bod" oncontextmenu="return false">