Jump to content

2 questions


Gif
 Share

Recommended Posts

1st question.. how can i create a label that allowes me to copy the data(or an input without borders) like this:

post-22792-1189349160_thumb.jpg

2nd question.. how can i create a tool window that can be dragged and fit in my parent gui like this:

post-22792-1189349298_thumb.jpg

post-22792-1189349290_thumb.jpg

Edited by Gif
Link to comment
Share on other sites

#include<GUIConstants.au3>
$gui=GUICreate("test" , -1,-1,-1,-1)
$test=""
For $i=0 To 40
    $test=$test&@CRLF&"sadasdasjd"
Next

$edit=GUICtrlCreateEdit("text here"&$test, 1,1,400,400,$SS_BLACKFRAME+$ES_READONLY+$WS_VSCROLL)
GUICtrlSetBkColor($edit,0xffffff)
GUISetState()


While 1
    Sleep(10)
    If GUIGetMsg()=$GUI_EVENT_CLOSE Then Exit
WEnd

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Link to comment
Share on other sites

  • 1 month later...

I'd also like to know the answer to question number two....

I would really like to build a program that could use toolwindows like that

We may have to actually write our own udf to do it.... Idk, not too sure...

I haven't tried this but perhaps you could detect the dragged and dropped window then set it to be a child of the window it was dropped into using

DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($DraggedDropped), "hwnd", WinGetHandle($Container))

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I don't like alexmadman's way. I like it more this way:

#include <GUIConstants.au3>


$Form1 = GUICreate("Form1", 368, 163, 206, 120)
GUICtrlCreateEdit("I'd also like to know the answer to question number two....I would really like to build a program that could use toolwindows like thatWe may have to actually write our own udf to do it.... Idk, not too sure...", 32, 10, 311, 53, BitOR($ES_NOHIDESEL,$ES_WANTRETURN,$ES_READONLY), 0)
GUICtrlSetBkColor(-1,0xD6D3CE)
$Button1 = GUICtrlCreateButton("Button1", 131, 110, 105, 33, $BS_DEFPUSHBUTTON)
GUISetState(@SW_SHOW)
ControlFocus($Form1,"",$Button1)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Exit
    EndSwitch
WEnd

And as for question number 2, I don't know. But would be cool.

Link to comment
Share on other sites

#include <GUIConstants.au3>
#include <GUIListview.au3>
$big = GuiCreate( "big win", 800, 600, -1, -1 )
GUISetBkColor( 0x0000ff )
$panels = GUICtrlCreateMenu('Active Windows')         ;CREATES THE MENU
$pctrlH = GUICtrlCreateMenuItem( "Gui 1", $panels )   ;MENU ITEM FOR GUI ONE
GUICtrlSetState(-1,$GUI_CHECKED)                       ;Check it since it will be shown
$win1 = 'Show'                                          ;Set the a Var to say that it's showing
                                                      ;Repeat this for the other gui
$qctrlH = GUICtrlCreateMenuItem( "Window 2", $panels )
GUICtrlSetState(-1,$GUI_CHECKED)
$win2 = 'Show'
GUISetState()                                          ;It has to be shown (@SW_SHOW) state so that _SetParent will work
$inside = GuiCreate( "GUI 1", 523, 216, 0, 0, Bitor($WS_CLIPSIBLINGS, $WS_SIZEBOX), $WS_EX_TOOLWINDOW )   ; CREATE GUI 1
GUISetBkColor(0xffffff)
Global $Slider1 = GUICtrlCreateSlider(8, 152, 502, 45, -1, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))  ; ADD A LITTLE CONTROL...
GUICtrlSetBkColor( -1, 0x0000ff )
GUICtrlSetColor( -1, 0xff0000 )
GUISetState(@SW_SHOW) 
$inside2 = GuiCreate( "Window 2", 538, 215, 0, 222, $WS_SIZEBOX, $WS_EX_TOOLWINDOW)   ; ADD GUI 2 
GUISetBkColor(0xbf9ffa)
GUISetState(@SW_SHOW) 



_SetParent( "GUI", "big" )      ;SET THEM BOTH TO BE A CHILD WIN
_SetParent( "Window 2", "big" )   ;SET THEM BOTH TO BE A CHILD WIN


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        EndSwitch
        
        If $pctrlH = $nMsg Then
            If $win1 = 'Show' then 
                GUISetState(@SW_HIDE, $inside )
                GUICtrlSetState($pctrlH,$GUI_UNCHECKED)
                $win1 = 'Hide'
            Else
                GUISetState(@SW_SHOW, $inside )
                GUICtrlSetState($pctrlH,$GUI_CHECKED)
                $win1 = 'Show'
            Endif
        Endif
        If $qctrlH = $nMsg Then
            If $win2 = 'Show' then 
                GUISetState(@SW_HIDE, $inside2 )
                GUICtrlSetState($qctrlH,$GUI_UNCHECKED)
                $win2 = 'Hide'
            Else
                GUISetState(@SW_SHOW, $inside2 )
                GUICtrlSetState($qctrlH,$GUI_CHECKED)
                $win2 = 'Show'
            Endif
        Endif
        
WEnd









Func _SetParent($TitleP, $TitleC)
    If WinExists($TitleP) Then
        If WinExists($TitleC) Then
            $HwndP = WinGetHandle($TitleP)
            $HwndC = WinGetHandle($TitleC)
            $user32 = DllOpen("user32.dll")
            DllCall($user32, "str", "SetParent", "HWnd", $HwndP, "HWnd", $HwndC)
            DllClose( $user32 )
            Return 1
        Else
            Return -1
        EndIf
    Else
        Return -1
    EndIf
EndFunc   ;==>_SetParent

[center][/center]

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...