Jump to content

Creating a Control that Looks Like a Table


CE101
 Share

Recommended Posts

I've just begun using this program, so my apologies if I am asking a very foolish question...

I am writing a script that automates the creation of a fax log from Winfax.

I've created a GUI that contains a number of GUIControls (radios and buttons) as follows...

GUICreate("Export Type Selection", 500)

GuiCtrlCreateLabel("This script accomodates two types of exports, each with its own set of fields", 10, 10)

GuiCtrlCreateLabel("< Here's where I want the table to go> ", 10, 40 )

GuiCtrlCreateLabel("Which one do you want? ", 10, 160)

GuiCtrlCreateGroup("Export Types", 10, 220, 140, 70)

$Radio_Export1 = GUICtrlCreateRadio(" Failed Fax Log", 20, 240, 120, 20)

$Radio_Export2 = GUICtrlCreateRadio(" Full Fax Log", 20, 260, 120, 20)

GUICtrlCreateGroup ("",-99,-99,1,1) ;close group

$Button1_Continue = GuiCtrlCreateButton("Continue", 100, 300, 120, 20)

$Button2_Quit = GuiCtrlCreateButton("Quit", 100, 320, 120, 20)

GUISetState()

At line 3 I want to include the attached table (see below)...

What's the best way to do this?

A series of labels or groups or both?

Any suggestions would be greatly appreciated.

Gary

post-58566-12770681043458_thumb.jpg

LogTypes.zip

Link to comment
Share on other sites

Listviews are what you want:

$hList = GUICtrlCreateListView("Export Type|Fields", 4, 4, 400, 200)
GUICtrlCreateListViewItem("Failed Fax log|Subject, Company, Name, Phone Number/CallerID, Error Code", $hList)
GUICtrlCreateListViewItem("Failed Fax log|Subject, Company, Name, Phone Number/CallerID, " & _
    "Date, Time, Duration, Type, Error Code, Status, Status Message, PAges, S/R, Retries, Resolution, Speed", $hList)

That shows the closest you'll get to the screenshot.

Mat

Link to comment
Share on other sites

Listviews are what you want:

$hList = GUICtrlCreateListView("Export Type|Fields", 4, 4, 400, 200)
GUICtrlCreateListViewItem("Failed Fax log|Subject, Company, Name, Phone Number/CallerID, Error Code", $hList)
GUICtrlCreateListViewItem("Failed Fax log|Subject, Company, Name, Phone Number/CallerID, " & _
    "Date, Time, Duration, Type, Error Code, Status, Status Message, PAges, S/R, Retries, Resolution, Speed", $hList)

That shows the closest you'll get to the screenshot.

Mat

You can get closer than that.

#include <staticconstants.au3>
$g = GUICreate("", 600, 400)
GUISetBkColor(0xFFFFFF)
Dim $al[6]
Dim $ht[3] = [30, 50, 50]
$top = 0
For $n = 0 To 2
    
    GUICtrlCreateLabel("", 20, 20 + $top, 101, $ht[$n] + 1, $SS_BLACKFRAME);BitOr($SS_CENTER,$SS_CENTERIMAGE,$SS_BLACKFRAME))
    GUICtrlCreateLabel("", 120, 20 + $top, 430, $ht[$n] + 1, $SS_BLACKFRAME)
    $top += $ht[$n]
    ConsoleWrite($top & @CRLF)
Next
$il = 0
$top = 5
For $n = 0 To 2
    
    $al[$il] = GUICtrlCreateLabel("", 25, 20 + $top, 91, $ht[$n] - 10);BitOr($SS_CENTER,$SS_CENTERIMAGE,$SS_BLACKFRAME))

    $al[$il + 1] = GUICtrlCreateLabel("", 125, 20 + $top, 420, $ht[$n] - 10)
    $top += $ht[$n]
    $il += 2
Next
For $n = 0 To 1
    GUICtrlSetFont($al[$n], 12, 800, -1, "Times New Roman")
Next
For $n = 2 To 5
    GUICtrlSetFont($al[$n], 10, 400, -1, "Times New Roman")
Next
 
GUICtrlSetData($al[0], "Export Type")
GUICtrlSetData($al[1], "Fields")
GUICtrlSetData($al[2], "Failed Fax Log")
GUICtrlSetData($al[3], "Subject, Company, Name, Phone Number/CallerID, Date, Time, Duration, Type, Error Code, Status, Status Message, PAges, S/R, Retries, Resolution, Speed")
GUISetState()

while GUIGetMsg() <> -3
    WEnd

Andybiochem wrote a udf for this.

I even wrote a string grid script myself but it needs work to use it, though it shows some possibilities.

Edited by martin
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

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