Jump to content

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 post
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 post
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 post
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 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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By AntS
      Help! The mouse clicks I'm sending to a control on a dialog box produce no response.
      The dialog box in question handles advanced display properties. The tab page my script interacts with is created by Trident Microsystems. It allows the user to enhance or attenuate the screen's RGB values. (See image.) My script automates the process of changing these in order to adjust the screen's hue or, when the red, green and blue values are all the same, the brightness.
      Producing a script to change the brightness has been quite straightforward. I use ControlClick() to send a mouse click to one of the trackbars on the right of the tab page. By default, they're linked and so move as one. The difficulty I'm having however is in automating the process when the desired red, green and blue values aren't the same as each other.
      Ordinarily, there are three ways of doing this: 
      (1) clear the Link check box to unlink the three trackbars then either click on each trackbar or drag their sliders,
      (2) clear the Link tick-box then for each colour, click on the corresponding trackbar slider (to select it) then click on a point on the graph, and
      (3) click on the Load button to open an Open dialog box and load a preset (stored as a .gam file).
      However, when ControlClick() is used to clear the Link check box or to push the Load button, nothing happens. Making the dialog box the active window makes no difference.
      The AutoIt Window Info tool indicates that the Reload a Bitmap, Save, Load and Reset buttons, the Link check box and the graph are all the same control. (See other images.) In fact, it there are only four controls on the page: the tab page, which is an instance of a SysTabControl32 class, and the three trackbars, each of which is an instance of the TridentTrackBar class. (Am unsure whether the SysTabControl32 class is a Windows or third-party control.)
      What's the solution?
      Note that the MouseClick() function—as opposed to ControlClick()—does work, but having AutoIt commandeer the screen pointer isn't an acceptable solution.
      For the sake of completeness, here's the relevant code fragment for the Link check box. 
      ;unlink trackbars WinActivate("(Multiple Monitors)") ControlClick("(Multiple Monitors)", "", 12320, "left", 1, 211, 252)  



    • By Cengokill
      Hi everyone,
      I have created a ListView that is in a tab, and I want to display an image in that tab, with the ListView on top.
      However, the image still appears on top of my ListView.
      If I remove the tabs everything works. 
      I looked at the autoit documentation and the <GuiListView.au3> documentation , I can't figure out how to display a background image, and put on top a ListView, inside a tab. 😥
      Here is the code:
      Opt("GUIOnEventMode", 1) $Form1 = GUICreate($Titre, 700, 627, $Form1Width, $Form1Height); main window $tabulation = GUICtrlCreateTab(148,0,700,580); creating tabs $tab1=GUICtrlCreateTabItem("Tab 1"); first tab GUICtrlSetState(-1, $GUI_SHOW); this tab is selected by default $Pic1 = GUICtrlCreatePic("image.jpg", 0, 30, 700, 627) GUICtrlSetState(-1, $GUI_DISABLE). $idListview = GUICtrlCreateListView("list 1|list 2|list 3", 200, 50, 390, 200) GUISetState(@SW_SHOW) While 1     Sleep(100) WEnd Thank you in advance.

    • By rudi
      Hi,
      from other postings here as a start I'm quite Close to my Goal of putting formatted text to the clipboard:
      #include-once #include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <WindowsConstants.au3> Global $g_idLblMsg, $g_hRichEdit Example("The first text will be formatted ""as is""" & @CRLF & _ "(Default Font and font size)", "This text is formatted differently") MsgBox(0, "Rich Text copied", "Formatted Text put to clipboard") Func Example($TextDefault, $TextCourier) Local $hGui, $iMsg, $idBtnNext, $iStep = 0 $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, StringLen(".exe")) & ")", 320, 350, -1, -1) $g_hRichEdit = _GUICtrlRichEdit_Create($hGui, $TextDefault, 10, 10, 300, 220, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) $g_idLblMsg = GUICtrlCreateLabel("", 10, 235, 300, 60) GUISetState(@SW_SHOW) _GUICtrlRichEdit_SetSel($g_hRichEdit, -1, -1) ; set selection behind last CHAR in RTF_EDIT _GUICtrlRichEdit_SetFont($g_hRichEdit, 8, "Courier New") ; change font to 8pt, Courier New _GUICtrlRichEdit_AppendText($g_hRichEdit, @CRLF & $TextCourier) _GUICtrlRichEdit_SetSel($g_hRichEdit, 0, -1) ; select all the content of the RTF_EDIT _GUICtrlRichEdit_Copy($g_hRichEdit) ; put the selection to the clipboard EndFunc ;==>Example  
      Finally the clipboard content has to hold pre-formatted data to be pasted into an email body. for the 2nd part I'd like to add a frame around the text, like I did manually before taking this screenshot.



      Any suggestions, or maybe some absolutely different Approach?
       
      CU, Rudi.
    • By Blois
      Hi Guis,
       
      I need to create keyboard shortcut to navigate the tabs and activate them, but I could not use the code below:
      #include <TabConstants.au3> #include <WindowsConstants.au3> #include <GuiTab.au3> #include <GUIConstantsEx.au3> HotKeySet("^{TAB}", "_TabRight") HotKeySet("^+{TAB}", "_TabLeft") $gui = GUICreate("test",450, 300) $Tab1 = GUICtrlCreateTab(20, 24, 425, 201) $TabSheet1 = GUICtrlCreateTabItem("Tabsheet 1") $lbContagemGrupos2 = GUICtrlCreateLabel("aaaa", 50, 50) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateTabItem("") $TabSheet2 = GUICtrlCreateTabItem(" ") $TabSheet3 = GUICtrlCreateTabItem(" ") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _TabRight() $CurPos = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab1, $CurPos + 1) $tab = "$TabSheet" & $CurPos GUICtrlSetState($TabSheet1 + $CurPos, $GUI_SHOW) Return EndFunc Func _TabLeft() $CurPos = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab1, $CurPos - 1) $tab = "$TabSheet" & $CurPos GUICtrlSetState($TabSheet1 + $CurPos, $GUI_SHOW) Return EndFunc Exit  
      can you help me?
    • By FroVN
      I made a software that download music and play it, but i have an idea , listen music online when we have internet connectionm ,no need for download any more, so i want to connect to soundclound but if wan to do that i need  to open google chrome , so is there any way to open that in hide and not show on taskbar? sorry for my bad english
×
×
  • Create New...