Jump to content

Transparent Input GUI


ReFran
 Share

Recommended Posts

Hello,

I want to Drag&Drop files on a ListView GUI. Because that is - to my greatly big regret - not posible, I want to solve it with a Transparent GUI Inputbox, which accept files. Attached the (basic) code for the Transparent Input box.

Is that the right way or there are better solutions?

Thanks, Reinhard

PS: The transparency I set to 100 (only for this demo) B)

#include <GUIConstants.au3>

GUICreate("MyGUI", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018)

$file = GUICtrlCreateInput ( "", 10,  5, 300, 40)
GUICtrlSetState(-1,$GUI_ACCEPTFILES)
WinSetTrans ( "MyGUI", "", 100)

GUISetState () 

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
       $msg = GUIGetMsg()
Wend
Link to comment
Share on other sites

It could work, you would just have to keep it docked over the listview, so any time the main gui moves or is resized you would have to do the same to the dragdrop gui

problem, the transparent gui would be in the way of directly working with the listview.

#include <GUIConstants.au3>

$my_Gui = GUICreate("MyGUI", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018)

$file = GUICtrlCreateInput ( "", 10,  5, 300, 40)
GUICtrlSetState(-1,$GUI_ACCEPTFILES)
WinSetTrans ( $my_Gui, "", 2)

GUISetState () 

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
 $msg = GUIGetMsg()
 If StringLen(GUICtrlRead($file)) Then
  ConsoleWrite(GUICtrlRead($file) & @LF)
; do something
  GUICtrlSetData($file,"")
 EndIf
Wend
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Thanks Gary,

I think far more then the half of my 700 basic codelines for my PDF Manger are direct or indirect from you.

"It could work, you would just have to keep it docked over the listview, so any time the main gui moves or is resized you would have to do the same to the dragdrop gui"

For luck, I'm far away from to be able to set up a resizeable GUI. I think I can put it over the listview, when the listview is in the foreground and PDF Manager lose the focus (Win-not-active).

"problem, the transparent gui would be in the way of directly working with the listview."

As soon as the PDF Manager get back focus, the input box will be disabled. At time I work with a input box direct under the treeview (Drag&Drop files here) and I considered in the GUI While loop already to get Draged&Droped files without further action. So I think I can change it slowly.

However, I will test it and report back, but I need some time for it.

Best regards, Reinhard

;;;;;; Actual GUI-Loop ;;;;;;;;;;;;;;;;;;;;;;;;

While 1

$msg = GUIGetMsg()

;;;;;;;; Handling of Drag and Drop Files ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

$xFileDD = GuiCtrlRead($FileDD)

if stringInStr($xFileDD,".pdf") > 0 then

$xFileDD = stringReplace($xFileDD,"Drag & Drop new files here!","")

GUICtrlSetData($fileDD,"Drag & Drop new files here!")

_PrepDDtoLv($xFileDD)

endIf

....

.....

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...