Jump to content

GUICtrlRichEdit in Tab control


 Share

Recommended Posts

Hi,

Cant get this RichEdit box to display in in a specific tab...what am I missing?

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>
#include <GuiStatusBar.au3>
#include <GuiEdit.au3>
#include <misc.au3>
Opt('MustDeclareVars', 1)

Example()
Func Example()
Local $tab, $tab0, $tab0OK, $tab0input
Local $tab1, $tab1combo, $tab1OK
Local $tab2, $tab2OK, $msg
local $hRichEdit,$hGui

$hGui=GUICreate("My GUI Tab", 250, 150); will create a dialog box that when displayed is centered
GUISetBkColor(0x00E0FFFF)
GUISetFont(9, 300)

$tab = GUICtrlCreateTab(10, 10, 200, 100)

$tab0 = GUICtrlCreateTabItem("tab0")
; GUICtrlCreateLabel("label0", 30, 80, 50, 20)
; $tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20)
; $tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20)
$hRichEdit = _GUICtrlRichEdit_Create($hGui, "ss", 80, 50, 70, 20, BitOR($ES_MULTILINE, $WS_VSCROLL))

$tab1 = GUICtrlCreateTabItem("tab----1")
GUICtrlCreateLabel("label1", 30, 80, 50, 20)
$tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120)
GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon"); default Jon
$tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

$tab2 = GUICtrlCreateTabItem("tab2")
GUICtrlSetState(-1, $GUI_SHOW); will be display first
GUICtrlCreateLabel("labeqqqql2", 30, 80, 50, 20)
$tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50)

GUICtrlCreateTabItem(""); end tabitem definition
GUICtrlCreateLabel("Click on tab and see the title", 20, 130, 250, 20)
GUISetState()

; Run the GUI until the dialog is closed
While 1
  $msg = GUIGetMsg()
  If $msg = $GUI_EVENT_CLOSE Then ExitLoop
  If $msg = $tab Then
   ; display the clicked tab
   WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($tab))
  EndIf
WEnd
EndFunc   ;==>Example

tnx ;)

E.

Link to comment
Share on other sites

I don't know, but since it seems not to show, maybe you could do this for the moment to get round it.

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>
#include <GuiStatusBar.au3>
#include <GuiEdit.au3>
#include <misc.au3>
;Opt('MustDeclareVars', 1)

Example()
Func Example()
Local $tab, $tab0, $tab0OK, $tab0input
Local $tab1, $tab1combo, $tab1OK
Local $tab2, $tab2OK, $msg
local $hRichEdit,$hGui

$hGui=GUICreate("My GUI Tab", 250, 150); will create a dialog box that when displayed is centered
GUISetBkColor(0x00E0FFFF)
GUISetFont(9, 300)
$ch1 = GUICreate("",192,70,12,34,$WS_CHILD,-1,$hGui)

$hRichEdit = _GUICtrlRichEdit_Create($ch1, "ss", 0, 0, 190, 68);, BitOR($ES_MULTILINE, $WS_VSCROLL))
GUISetState()
GUISwitch($hGui)
$tab = GUICtrlCreateTab(10, 10, 200, 100)

$tab0 = GUICtrlCreateTabItem("tab0")

$tab1 = GUICtrlCreateTabItem("tab----1")
GUICtrlCreateLabel("label1", 30, 80, 50, 20)
$tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120)
GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon"); default Jon
$tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

$tab2 = GUICtrlCreateTabItem("tab2")
;GUICtrlSetState(-1, $GUI_SHOW); will be display first
GUICtrlCreateLabel("labeqqqql2", 30, 80, 50, 20)
$tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50)

GUICtrlCreateTabItem(""); end tabitem definition
GUICtrlCreateLabel("Click on tab and see the title", 20, 130, 250, 20)
GUISetState()

; Run the GUI until the dialog is closed
While 1
  $msg = GUIGetMsg()
  If $msg = $GUI_EVENT_CLOSE Then ExitLoop
  If $msg = $tab Then
   ; display the clicked tab
   WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($tab))
   if guictrlread($tab) = 0 Then
       GUISetState(@SW_SHOW,$ch1)
   Else
       GUISetState(@SW_HIDE, $ch1)
       EndIf
  EndIf
WEnd
EndFunc   ;==>Example
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

  • Moderators

xtrim,

The Tabs tutorial in the Wiki will explain all. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 1 year later...

I borrowed the example above and can't seem to understand why is this not working as it should.  I followed the instructions in the wiki in regards to hiding UDF controls when used on an internal Tab, but it still bleeds through.

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <GuiTab.au3>
#include <WindowsConstants.au3>
#include <GuiStatusBar.au3>
#include <GuiEdit.au3>
#include <misc.au3>
#include <GuiRichEdit.au3>
Opt('MustDeclareVars', 1)

Example()
Func Example()
    Global $tab, $tab0, $tab0OK, $tab0input
    Global $tab1, $tab1combo, $tab1OK
    Global $tab2, $tab2OK, $msg
    Global $hRichEdit, $hGui

    $hGui = GUICreate("My GUI Tab", 250, 150); will create a dialog box that when displayed is centered
    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

    $tab = GUICtrlCreateTab(10, 10, 200, 100)

    $tab0 = GUICtrlCreateTabItem("tab0")
    ; GUICtrlCreateLabel("label0", 30, 80, 50, 20)
    ; $tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20)
    ; $tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20)
    $hRichEdit = _GUICtrlRichEdit_Create($hGui, "ss", 80, 50, 70, 20, BitOR($ES_MULTILINE, $WS_VSCROLL))


    $tab1 = GUICtrlCreateTabItem("tab----1")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    $tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon"); default Jon
    $tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

    $tab2 = GUICtrlCreateTabItem("tab2")
    GUICtrlSetState(-1, $GUI_SHOW); will be display first
    GUICtrlCreateLabel("labeqqqql2", 30, 80, 50, 20)
    $tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50)

    GUICtrlCreateTabItem(""); end tabitem definition
    GUICtrlCreateLabel("Click on tab and see the title", 20, 130, 250, 20)
    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        If $msg = $tab Then
            ; display the clicked tab
            WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($tab))
        If _GUICtrlTab_GetCurSel($tab) = 0 Then
            GUISetState(@SW_SHOW, $hRichEdit)
        Else
            GUISetState(@SW_HIDE, $hRichEdit)
        EndIf
                EndIf
    WEnd
EndFunc   ;==>Example
_GUICtrlRichEdit_Destroy($hRichEdit)
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

×
×
  • Create New...