Jump to content

Issue with read only edit box


Recommended Posts

Basically I'm trying to create a read only edit box to be used as a log output in my GUI.

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

mainGui()

Func mainGui()
#Region ### START Koda GUI section ### Form=
$mqInputGUI = GUICreate("MQ Input Scenario", 623, 814, 192, 122)
$fileMenu = GUICtrlCreateMenu('&File')
$fileMenuLoad = GUICtrlCreateMenuItem('Load Scenario', $fileMenu)
$fileMenuSave = GUICtrlCreateMenuItem('Save Scenario', $fileMenu)
$treeView1 = _GUICtrlTreeView_Create($mqInputGUI, 248, 16, 361, 433)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$addNewButton = GUICtrlCreateButton("Add New Item", 16, 40, 209, 49)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$removeButton = GUICtrlCreateButton("Remove Selected Item", 16, 120, 209, 49)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$logging = GUICtrlCreateGroup("Logging", 16, 464, 593, 329)
$loggingEdit = GUICtrlCreateEdit("", 32, 488, 561, 289)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$moveUpButton = GUICtrlCreateButton("Move Up", 16, 200, 209, 49)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$moveDownButton = GUICtrlCreateButton("Move Down", 16, 280, 209, 49)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
$logging = GUICtrlCreateGroup("Logging", 16, 464, 593, 329)
$loggingEdit = _GUICtrlEdit_Create($mqInputGUI, "", 32, 488, 561, 289, BITOR($ES_NOHIDESEL, $ES_AUTOVSCROLL, $WS_HSCROLL, $WS_VSCROLL, $ES_MULTILINE, $ES_READONLY))
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
_GUICtrlEdit_InsertText($loggingEdit, 'Testing...')
GUICtrlCreateGroup("", -99, -99, 1, 1)
$startScenarioButton = GUICtrlCreateButton("Start Scenario", 16, 360, 209, 49)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)

GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg(1) ; Use advancedparameter to get array
Switch $nMsg[1] ; check which GUI sent message
Case $mqInputGUI
Switch $nMsg[0] ; now check for the messages to $mqInputGui only
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
EndSwitch
WEnd
EndFunc

What is actually happening though is that when I click on the edit box it hides anything that is currently in there and lets me start typing.

Is there something that I'm doing wrong?

Thanks!

Link to comment
Share on other sites

You have created 2 edit controls in the same location on the GUI, and 2 group controls as well, fix that and see if it works better.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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