Sign in to follow this  
Followers 0
Glyph

Completly erase guictrledit window?

9 posts in this topic

#1 ·  Posted (edited)

#include <GUIConstants.au3>
;------------------------------------Variables!-------------------------
$date = InputBox("Input Date","Current date setter for the time being.")
$hexbk = IniRead(@ScriptDir&"\Settings.ini","Background","0","0x666666")
$sbdir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\StealthBot v2.6 Revision 3", "Install_Dir")
$weee=GuiCreate("SB Log Reader v0.1", 750, 550)
$cont1=GUICtrlCreateEdit("Planning to add seperate gui for date searching, as well as a bettrr gui, this is only a test!",10,10,700,500,1)
$n1=GUICtrlCreateCheckbox ("Check whispers log",10,520)
$n2=GUICtrlCreateCheckbox ("Check chat log",120,520)
$okbtn = GUICtrlCreateButton("&Update", 620, 520, 80, 25, 0)



GUISetBkColor ($Hexbk)
GUISetState(@SW_SHOW)

;------------------------------------Structure!-------------------------
While 1
    $msg = GUIGetMsg()
    Select
  Case $msg = $okbtn
   If BitAnd(GUICtrlRead($n1),$GUI_CHECKED) = $GUI_CHECKED Then
       GUICtrlSetData($cont1,"omg hacks", "text update")
MsgBox(0,"First test","Whisper")

EndIf
   If BitAnd(GUICtrlRead($n2),$GUI_CHECKED) = $GUI_CHECKED Then
GUICtrlSetData($cont1,"omg hacks", "text update")
MsgBox(0,"Second test","Chat")
   EndIf
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
            
    EndSelect
WEnd

i just want everything behind to dissapear and have "omg hacks" to appear in its place.

note: _GUICtrlEditReplaceSel does not work!

Edited by backstabbed

tolle indicium

Share this post


Link to post
Share on other sites



Ok, let me see if I got this one right... Do you want it so that when the user has checked the checkboxes

and presses the button, the current text is cleared and it's set to "omg hacks" instead ? Well, if so, why on

earth do you have the last parameter set to a non-blank value ? It's pretty clear in the helpfile that the text

then is inserted instead of replacing the text...

for Edit, Input : if defined and not "" the "data" string is inserted not overriding the previous value at the caret point.

Recreating the edit-control is a pretty weird way of doing it, and I hope you weren't seriously thinking that

this was the only or best way of solving it.

Share this post


Link to post
Share on other sites

It's teh easiest :)


tolle indicium

Share this post


Link to post
Share on other sites

Maybe on your planet, but on mine it's more retarded, has more lines and it's not too funky either.

GUICtrlSetData($cont1,"omg hacks")oÝ÷ ÚûºÚ"µÍÕRPÝ[]J  ÌÍØÛÛJBÌÍØÛÛQÕRPÝÜX]QY]
    ][ÝÉ][ÝËLL
Ì
LJBÕRPÝÙ]]J  ÌÍØÛÛ  ][ÝÛÛYÈXÚÜÉ][ÝË    ][ÝÝ^]I][ÝÊ

Hell yeah, that's teh easiest alright.

Share this post


Link to post
Share on other sites

GUICtrlSetData($cont1,"")
GUICtrlSetData($cont1,"omg hacks")

Clear the data first, by sending a blank string ""

Set the new data

simple as that. (and yes, it does explain this in the helpfile too...)

Share this post


Link to post
Share on other sites

GUICtrlSetData($cont1,"")
GUICtrlSetData($cont1,"omg hacks")

Clear the data first, by sending a blank string ""

Set the new data

simple as that. (and yes, it does explain this in the helpfile too...)

Why clear it in the first and replace nothing with "omg hacks" in the second, when you can just replace

it immediately in the first GUICtrlSetData, as I showed in my previous post. Hey, would you look at that..

This is also explained in the helpfile !

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Why clear it in the first and replace nothing with "omg hacks" in the second, when you can just replace

it immediately in the first GUICtrlSetData, as I showed in my previous post. Hey, would you look at that..

This is also explained in the helpfile !

your correct, what I was trying to show was how to clear it, thats all. I wasn't saying that you didn't have knowledge of what was expressly stated in the helpfile, Helge, I was just expressing a concept in a different way (the helpfile comment was directed at the OP, anyhow). The title of the thread is "Completely erase a guictrledit window?", and then in the first thread the OP explains that he wants it erased, and then to have something new inserted in its place. I was doing it step-by-step so that he could erase it and leave it blank, if he wanted to. At the time of my posting you had already shown how to replace the content, I wanted to show how to blank it out. Simple concept, but the OP might not have realized it otherwise.

Edited by improbability_paradox

Share this post


Link to post
Share on other sites

Yeah, I see improb, but you got to look at the guy on the other side as well and his methods used...

When they want to update or replace the text of a control and they go on and solves it by recreating

the control like that....well, then I do my own thinking instead of looking at what's said and suggested

in the way the question is given.

Share this post


Link to post
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
Sign in to follow this  
Followers 0