xXDarknessXx
Joined: 03 Sep 2009 Posts: 93
|
Posted: Thu Sep 03, 2009 10:53 am Post subject: SQL Plus! |
|
|
In tafe i was bored so i made an easier way to use SqlPlus from Oracle, SqlPlus didnt allow editing what you have typed unless u backspace back to the error and retype the sentance, with my script it adds a bar at the bottom of the window that you can type in and edit openly.
some shortcuts I have added are:
Hold Left Alt = Makes the edit bar at the bottom invisible\transparent.
Control+Up Arrow = Get Previously sent commands [i dont know how deep this goes]
Control+Down Arrow = Get Next sent commands
| Code: | #SingleInstance Force
SetControlDelay -1
IfNotExist , AutoSQL+.ini
{
IniWrite , DEFAULT, AutoSQL+.ini , Settings , UserName
IniWrite , DEFAULT , AutoSQL+.ini , Settings , Password
runwait AutoSQL+.ini
}
IfWinNotExist, ahk_class SqlplusWClass
{
IniRead , USER, AutoSQL+.ini , Settings , UserName
IniRead , PASS, AutoSQL+.ini , Settings , Password
run C:\ora\devsuite10\BIN\sqlplusw.exe S%USER%/%PASS%@stud ;~ Put the path of the sqlplusw.exe
winwait, ahk_class SqlplusWClass
goto SQLEasy
}
Else
{
WinActivate, ahk_class SqlplusWClass
goto SQLEasy
}
return
SQLEasy:
Gui 1: -caption
Gui 1: +ToolWindow +AlwaysOnTop +border
Gui 1: color , White
Gui 1: font, s10 w700 , Verdana
GuiHidden = 0
WinGetPos , posX, posY, winW, winH, ahk_class SqlplusWClass
newY := posY + winH - 67
newX := posX + 3
newW := winW - 26
editW := newW - 85
butX := 5 + editW
miniX := winW - 40
Gui 1: Add, Edit, x0 y0 w%editW% h45 vSQLEdit +Center +Multi
Gui 1: Add, Button, x%butX% y5 w55 h35 Default, Enter
Gui 1: Add, Button, x%miniX% y0 w15 h45 vHider, >
SetTimer , moveToolbar , 10
refresh:
Gui 1: Show, x%newX% y%newY% w%newW% h45, Easy SQL
GuiControl,, SQLEdit,
GuiControl, Focus, SQLEdit
Return
moveToolbar:
IfWinActive, ahk_class SqlplusWClass
{
WinGetPos , posX, posY, winW, winH, ahk_class SqlplusWClass
newY := posY + winH - 67
if(GuiHidden = 1)
{
newX := posX + winW - 37
newW := 14
miniX = 0
}
Else
{
newX := posX + 3
newW := winW - 26
editW := newW - 85
butX := 5 + editW
miniX := winW - 40
GuiControl, Move, SQLEdit, x0 y0 w%editW% h45
GuiControl, Move, Enter, x%butX% y5
}
GuiControl, Move, Hider, x%miniX% y0
Gui 1: Show, NoActivate x%newX% y%newY% w%newW% h45, Easy SQL
}
else
{
IfWinNotActive, Easy SQL
{
Gui 1: hide
}
}
IfWinNotExist, ahk_class SqlplusWClass
{
exitapp
}
SetTimer , moveToolbar , 10
return
#IfWinActive, Easy SQL
{
Enter::
NumpadEnter::
ButtonEnter:
SentCount++
CommandNumber = %SentCount%
Gui 1: Submit , NoHide
WinActivate , ahk_class SqlplusWClass
WinWaitActive, ahk_class SqlplusWClass
ControlSend , , %SQLEdit%; , ahk_class SqlplusWClass
ControlSend , , {Enter} , ahk_class SqlplusWClass
Command%SentCount% = %SQLEdit%
Gui 1: show
GuiControl, Focus, SQLEdit
SendInput, {end}
SendInput, ^a
return
^Up::
if(CommandNumber > 1)
CommandNumber--
newCommand := Command%CommandNumber%
GuiControl,, SQLEdit, %newCommand%
Return
^Down::
if(CommandNumber < SentCount)
CommandNumber++
newCommand := Command%CommandNumber%
GuiControl,, SQLEdit, %newCommand%
Return
LAlt::
Winset, trans , 10 , Easy SQL
return
LAlt up::
Winset, trans , off , Easy SQL
return
}
Button>:
WinGetPos , posX, posY, winW, winH, ahk_class SqlplusWClass
newY := posY + winH - 67
if(GuiHidden = 0)
{
newX := posX + winW - 37
newW := 14
miniX = 0
GuiHidden = 1
GuiControl, Hide, SQLEdit
GuiControl, Hide, Enter
GuiControl,, Hider, <
}
Else
{
newX := posX + 3
newW := winW - 26
editW := newW - 85
butX := 5 + editW
miniX := winW - 40
GuiHidden = 0
GuiControl, Show, SQLEdit
GuiControl, Show, Enter
GuiControl,, Hider, >
}
GuiControl, Move, Hider, x%miniX% y0
Gui 1: Show, NoActivate x%newX% y%newY% w%newW% h45, Easy SQL
return
GuiClose:
ExitApp |
I was wondering if i can have some input, like how i could improve this =][/u]
Last edited by xXDarknessXx on Fri Sep 04, 2009 2:34 am; edited 1 time in total |
|