Jump to content

Full-screen display - Table doesn't look right


Recommended Posts

I've developed a full-screen program to interface with a calendar (allows the user to show current bookings, etc on a screen in the front office), however, having some trouble with the table.

I'm looking for ideas on how to best 'attack' this in AutoIt.

Writing this in php, using html tables, css, etc. it looks great.

post-84345-0-91310700-1397832755_thumb.p

nice transparency, clean table lines, etc.

However, in porting this to AutoIt, I'm having trouble getting the table to display clean lines, transparency and good text.

I tried using an embedded html page (YUK - I have had better screens, but this is the 'best' with everything going on I want....)

post-84345-0-58844400-1397832922_thumb.p

and also using the Table UDF ('?do=embed' frameborder='0' data-embedContent>> things are much better, but not happy with the lines... - I have a simlar issue as reported page-2#entry841285)'>page-2#entry841285)

post-84345-0-60971600-1397833381_thumb.p

I'm happiest with the results from the Table UDF, but the odd black lines (on the shot above) appear here/there and change position depending on the data.  When configured to display a colored border, the issue is still there and often shows up worse as the 'missing' pixel or two create a large border and often with the missing pixel inside.

post-84345-0-88994700-1397834181_thumb.p

I chose the Table UDF because of the transparency, borders and easy-to-update text in each 'cell' - done as labels here (as I understand it, ListView, etc. can't do all that - I'm still pretty new with AutoIt and haven't learned all the best GUI bits yet).  And, I'm very happy with the results, other than those odd lines (which are keeping me from releasing the product).

Any suggestions on a better route to go to get nice, clean, no border, easily updated, transparent tables with AutoIt like the very easy to do html page?

Link to comment
Share on other sites

  • Moderators

TechCoder,

The lines in the table are caused when you pass fractional values for cell width - the rounding errors when the display converts these values to whole pixels produce the gaps. Convert your parameters to integer values and the problem goes away as you can see in this script based on the Table UDF example: :)

#include "Table.au3"

;----- GUI (Double Buffered) -----
$GUI = GUICreate("", 1350, 400, -1, -1, -1, 0x2000000)

;----- Make sure GUI exists BEFORE creating Tables -----
GUISetState()

;----- Lock GUI until tables drawn -----
GUISetState(@SW_LOCK)

$Table1 = _GUICtrlTable_Create(10, 10, 100.75, 40, 8, 6, 0) ; Fractional values <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
_GUICtrlTable_Set_RowHeight($Table1, 1, 35)
_GUICtrlTable_Set_Justify_All($Table1, 1, 1)
_GUICtrlTable_Set_TextFont_All($Table1, 8.5, 800, 0, "Tahoma")
_GUICtrlTable_Set_CellColor_Row($Table1, 1, 0x555555)
_GUICtrlTable_Set_TextColor_All($Table1, 0x555555)
_GUICtrlTable_Set_TextColor_Row($Table1, 1, 0xFFFFFF)
For $row = 3 To 10 Step 2
    _GUICtrlTable_Set_CellColor_Row($Table1, $row, 0xDDDDDD)
Next
_GUICtrlTable_Set_Text_Row($Table1, 1, "Fixing|Size|Weight|Net|Gross|Order")
_GUICtrlTable_Set_Text_Row($Table1, 2, "Block|20.0|0.01|300|340|No")
_GUICtrlTable_Set_Text_Row($Table1, 3, "Screw|8.5|0.3|50|100|No")
_GUICtrlTable_Set_Text_Row($Table1, 4, "Rivet|0.1|0.4|10|11|Yes")
_GUICtrlTable_Set_Text_Row($Table1, 5, "Rope|300.0|100.0|2|10|No")
_GUICtrlTable_Set_Text_Row($Table1, 6, "Tack|10.6|0.3|1000|1011|Yes")
_GUICtrlTable_Set_Text_Row($Table1, 7, "Nail|30.3|0.4|400|600|No")
_GUICtrlTable_Set_Text_Row($Table1, 8, "Staple|0.3|0.05|10000|12000|No")
_GUICtrlTable_Set_Border_Table($Table1, 0x555555)

$Table2 = _GUICtrlTable_Create(700, 10, 100, 40, 8, 6, 0) ; Integer values <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
_GUICtrlTable_Set_RowHeight($Table2, 1, 35)
_GUICtrlTable_Set_Justify_All($Table2, 1, 1)
_GUICtrlTable_Set_TextFont_All($Table2, 8.5, 800, 0, "Tahoma")
_GUICtrlTable_Set_CellColor_Row($Table2, 1, 0x555555)
_GUICtrlTable_Set_TextColor_All($Table2, 0x555555)
_GUICtrlTable_Set_TextColor_Row($Table2, 1, 0xFFFFFF)
For $row = 3 To 10 Step 2
    _GUICtrlTable_Set_CellColor_Row($Table2, $row, 0xDDDDDD)
Next
_GUICtrlTable_Set_Text_Row($Table2, 1, "Fixing|Size|Weight|Net|Gross|Order")
_GUICtrlTable_Set_Text_Row($Table2, 2, "Block|20.0|0.01|300|340|No")
_GUICtrlTable_Set_Text_Row($Table2, 3, "Screw|8.5|0.3|50|100|No")
_GUICtrlTable_Set_Text_Row($Table2, 4, "Rivet|0.1|0.4|10|11|Yes")
_GUICtrlTable_Set_Text_Row($Table2, 5, "Rope|300.0|100.0|2|10|No")
_GUICtrlTable_Set_Text_Row($Table2, 6, "Tack|10.6|0.3|1000|1011|Yes")
_GUICtrlTable_Set_Text_Row($Table2, 7, "Nail|30.3|0.4|400|600|No")
_GUICtrlTable_Set_Text_Row($Table2, 8, "Staple|0.3|0.05|10000|12000|No")
_GUICtrlTable_Set_Border_Table($Table2, 0x555555)

;----- Unlock GUI to show tables -----
GUISetState(@SW_UNLOCK)

;----- Loop -----
Do
    Sleep(10)

Until GUIGetMsg() = -3
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

YUP!  Exactly the issue.

Went through and checked for "/" and "Round", etc. and added Int() around it - looks great!

post-84345-0-20773600-1397916528_thumb.p

Of course, the background is now out of place a bit, but that is simple enough to fix (have to do the math in the same way instead of a separate equation - no biggie).

This puts me back on track with the project - THANKS!

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