Jump to content

A string grid (like a spread sheet)


martin
 Share

Recommended Posts

I wondered how to make a string grid and played around with some ideas. Since I don't actually need one it's ground to a halt ;)

Maybe some of the ideas will be useful to someone.

I got most things I was thinking of at least to the stage where I think I could make them work, but there are lots of things missing or incomplete.

I know that you can use the Excel UDF's or OpenOffice Calc UDFs but that wasn't the point and an AUtoIt string grid seemed like a good idea to me for a while ^_^ .

post-3602-1241291355_thumb.png

source = stringGrid01.zip

Edit made a couple of changes based on Yashied's post #4

mgrefStringGrid

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

Hi!

It is cool & mega-Fun.

But GuiCtrlSetOnHover_UDF.au3 is missing.

But, OK, I found it in another message.

I haven't used the hover udf, but obviously either I did or I intended to, so you can just comment out or delete the line

#include "GuiCtrlSetOnHover_UDF.au3".

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

Link to comment
Share on other sites

Well done, but when you click the mouse at the border of the grid cell is not activated. And still working slowly, and ..., but this great work.

^_^

5+

I think there are some things that could be done to improve the speed and maybe drawing the whole grid rather than building it like a brick wall would be better and faster.

I played with it again and made a change which makes redrawing the cells 3 times faster, and made it so that you can select at the border of a cell.

I updated the attached zip in the first post.

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

  • 4 months later...

Hi, martin

very nice code, congratulation

do you have plan to modify this UDF in order to edit array in a GUI, like GUICtrlCreateArray?

No plans at all.

If there is something you would like to do with it then I might be able to help.

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

No plans at all.

If there is something you would like to do with it then I might be able to help.

Sorry for late answer

I would Like a function to edit array that can be integrated in a GUI window with other controls, don't need interactive width or height resize, nor formula calculation or range selection, but do need scrolling bar, Columns alignment definition and optional title on top and left that can be copied from top row and left Column from the same Array.

I think it would be great UDF for those who need edit a database or large amount of data from an array, like me.

Thanks in advance

Link to comment
Share on other sites

  • 2 years later...

Would be useful as UDF...

Edited by MrCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Can I ask if there is a way to define a cell

so say Case $Buttonstart

$Cell1ColumA = SetText ("eoihf");

Just wodering ive been trying to pick through it looking for a way but havnt found anything really

You could have a function something like this

Func SetCellText($iCol, $iRow,$sText);where $iCol is from 1 to column number of columns, $iRow is from 1 to number of rows

Local $iCell
if $iCol < 0 or $iCol > $ColCount then return -1
if $iRow < 0 or $iRow > $RowCount then return -2

$iCell = $lab[($ColCount ) * ($irow - 1) + $icol]

GuiCtrlSetData($iCell, $sText)

endfunc

There is a $Cells array which holds 8 items of information for each cell including the text. The actual displayed cell is just a label in an array of labels ($lab).

The $Cells index is

$Row * $ColCount + $Col ;where $Row and $Col start at 0.

I'm not sure the $Cells array was used much if at all in the example I gave.

EDIT: The line style around a cell is stored there, but there is something needed because if you change the border of a cell (right click context menu) the border isn't shown untill the window is redrawn.

@MrCreator- I thought it might make a useful UDF when I started experimenting with it but there was very little interest and it needs a lot of work to make a useful udf. I did use a simplified version of it in one project but I don't have the spare time to play with it now.

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

I liked it. I only took a quick glance at the code. Some things seemed to be slightly suggish but I will have to check it again. I can imagine it being a fair bit of work to create a UDF using this. Still it's an excellent example. Thank you!

Edited by czardas
Link to comment
Share on other sites

I liked it. I only took a quick glance at the code. Some things seemed to be slightly suggish but I will have to check it again. I can imagine it being a fair bit of work to create a UDF using this. Still it's an excellent example. Thank you!

I'm glad you liked it. Yes, it is very sluggish, especially the first time the cells are drawn or when a column width or row height is changed. If you reduce the number of columns it helps and I think that in the project where I used the basic idea I only had 10 columns and only drew the cells which could be seen rather than all of them as I think the example does. My conclusion was that AutoIt is not the best language to use for this. It's probably more sensible to use an Excel udf or Open Office.
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

I'm glad you liked it. Yes, it is very sluggish, especially the first time the cells are drawn or when a column width or row height is changed. If you reduce the number of columns it helps and I think that in the project where I used the basic idea I only had 10 columns and only drew the cells which could be seen rather than all of them as I think the example does. My conclusion was that AutoIt is not the best language to use for this. It's probably more sensible to use an Excel udf or Open Office.

If you need a responsive grid or spreadsheet control, try to use a custom control implemented in a DLL like RAGrid or SpreadSheet. AutoIt is just too slow to draw a complete GUI effortlessly without external help. Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

  • 2 years later...

I know this is an old topic but I had a need for something like this.  I tried running it in Autoit v3 and it gives me a couple errors.

It first declared some constants that seemed to have been already declared in the newer version so I just remarked out those lines:

;Global Const $WM_ENTERSIZEMOVE = 0x231, $WM_EXITSIZEMOVE = 0x232
;Global Const $WS_EX_COMPOSITED = 0x2000000;to stop flashing graphics. Not essential and might increase CPU load so add/remove on resizing?

but the problem really is the variable $aSB_WindowInfo. It is refered to around line 1083 and it says it's undeclared:

    For $x = 0 To UBound($aSB_WindowInfo) - 1

Any ideas?

 

Link to comment
Share on other sites

I know this is an old topic but I had a need for something like this.  I tried running it in Autoit v3 and it gives me a couple errors.

It first declared some constants that seemed to have been already declared in the newer version so I just remarked out those lines:

;Global Const $WM_ENTERSIZEMOVE = 0x231, $WM_EXITSIZEMOVE = 0x232
;Global Const $WS_EX_COMPOSITED = 0x2000000;to stop flashing graphics. Not essential and might increase CPU load so add/remove on resizing?

but the problem really is the variable $aSB_WindowInfo. It is refered to around line 1083 and it says it's undeclared:

    For $x = 0 To UBound($aSB_WindowInfo) - 1

Any ideas?

yes, comment out the for loop and the "If $index = -1 Then Return 0", that should do it.

After all it was an idea and it was in 2009 and was not continued but you can continue it   =)

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

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