Jump to content



Photo

Grid input


  • Please log in to reply
9 replies to this topic

#1 Michel Claveau

Michel Claveau

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 352 posts

Posted 29 May 2009 - 01:56 PM

Hi!

Just a exemple of componant.
Not finished, but usable.

[autoit]#include-once
#include <GuiConstantsEx.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>


Global $s_GuiFocus_LastClassName="",$s_FocusNew=""
saiod1()
Exit


Func saiod1()
Local $AccelKeys, $gui, $atmp, $hListView, $clef
Local $contextmenu, $btnotes, $rpquit, $ligne, $xx, $yy
Local $llFocus=1,$ccFocus=1

$gui = GUICreate("Saisie 'GRID' ", 805, 400)
GUISetBkColor(0xffffaa)

;-----PopMenu-------
$contextmenu = GUICtrlCreateContextMenu(-1)
$pmenreg = GUICtrlCreateMenuItem('&Enregistrer', $contextmenu)
$pmcompte = GUICtrlCreateMenuItem('&Compte (naviguer vers)', $contextmenu)
$pmtiers = GUICtrlCreateMenuItem('&Tiers (naviguer vers)', $contextmenu)
GUICtrlCreateMenuItem("", $contextmenu)
$btnotes = GUICtrlCreateMenuItem('&Bloc-note(s)', $contextmenu)
GUICtrlCreateMenuItem("", $contextmenu)
$rpquit = GUICtrlCreateMenuItem('&Quitter (abandonner)', $contextmenu)
;-----PopMenu-------


$btdown=GUICtrlCreateButton("Down",10,-100,100,40)
$btup=GUICtrlCreateButton("Up",110,-100,100,40)
$btins=GUICtrlCreateButton("Ins",210,-100,100,40)
$btdel=GUICtrlCreateButton("Del",310,-100,100,40)
$btenter=GUICtrlCreateButton("Enter",410,-100,100,40)
$btesc = GUICtrlCreateButton("Echap", 510, -100, 100, 40)

GUICtrlCreateLabel(" {Up} {Down} {Tab} {Shift-Tab} {Ctrl-Ins} {Ctrl-Del} {Enter} {Esc} etc. ",30,10,400,30)

GUISetFont(14,400,0,"Arial Narrow")

Local $nblig=10,$nbcol=6
Dim $ligt[$nblig]=[30,30,60,30,30,30,30,30,30,30] ;size lines
Dim $colt[$nbcol]=[80,100,320,90,90,90] ;size col
Dim $coll[$nbcol]=["Compte","Tiers","Libell

Attached Files


Edited by Michel Claveau, 04 June 2009 - 08:23 AM.

  • footswitch likes this







#2 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,194 posts

Posted 29 May 2009 - 02:00 PM

These lines (copy&paste error)
$result ="Ligne : "& String($llFocus) [email="&@CRLF"]&@CRLF[/email] $result&="Col : "& String($ccFocus) [email="&@CRLF"]&@CRLF[/email] [email="&@CRLF"]&@CRLF[/email]
have to be changed to this
$result ="Ligne : "& String($llFocus) & @crlf $result&="Col : "& String($ccFocus)  & @crlf  & @crlf

Otherwise nice example :).

Edited by KaFu, 29 May 2009 - 02:01 PM.


#3 Michel Claveau

Michel Claveau

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 352 posts

Posted 29 May 2009 - 02:05 PM

Hi!

Thanks.
The problem is with forum, and BBCodes who "interprete" my exemple...

#4 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,194 posts

Posted 29 May 2009 - 02:10 PM

Anticipated something like that :)... Was in need of something like this 2 weeks ago, sadly I went into another direction (Listview with dynamic InputBox overlay)... maybe I'll change in the long run to your example :party:...

#5 Michel Claveau

Michel Claveau

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 352 posts

Posted 29 May 2009 - 02:16 PM

Re!

> Listview with dynamic InputBox overlay

Hmmmm...
I tried this way. It's fast.
But...
Difficult for use keyboard, for navigate cellule to cellule. I do not found how to have lines with differents heights.

Also, I tried another way: listview, then {Enter} open a child window, who contain all fields of the selected line. At close, values are set in listview's line. It's easy, but no nice, and no convivial.

Edited by Michel Claveau, 29 May 2009 - 02:19 PM.


#6 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,194 posts

Posted 29 May 2009 - 02:29 PM

Also, I tried another way: listview, then {Enter} open a child window, who contain all fields of the selected line. At close, values are set in listview's line. It's easy, but no nice, and no convivial.

Yep, that's the way I do it now (child gui with input control, described it wrong above :) ), and you're right, design is not nice and keyboard access is not possbile... that's why I guess I'll switch to your design in the long run :party:...

#7 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,202 posts

Posted 29 May 2009 - 06:14 PM

Hi!

Just a exemple of componant.
Not finished, but usable.


Looks good Michel.

(I like the comment because it compares to "not finished, not usable" for the one I posted :) )
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.

#8 Michel Claveau

Michel Claveau

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 352 posts

Posted 29 May 2009 - 08:10 PM

Hi!

Looks good Michel. (I like the comment


You like/found good only the comment?
Is it that, the "english humor" ?

We say that, in England, on June 1st, cars are going to run to the right (of road).
And, if the experiment is decisive, trucks will begin from July.

Can you confirm?

#9 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,202 posts

Posted 29 May 2009 - 10:10 PM

Hi!



You like/found good only the comment?
Is it that, the "english humor" ?


No, I said "looks good" and that was about your component.

The comment about your comment was just an extra, um, comment, and that bit was just my humour which might be British, I am unable to tell, but you can ignore it.

We say that, in England, on June 1st, cars are going to run to the right (of road).
And, if the experiment is decisive, trucks will begin from July.

Can you confirm?


:) Yes of course it's true, and if that works well cylists will begin in August. I hear that if that stage is reached the French will start the reverse process, (but beginning with roller skaters), because they don't want to drive on the same side as the British.
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.

#10 Michel Claveau

Michel Claveau

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 352 posts

Posted 04 June 2009 - 08:20 AM

Hi!

I have a second example, with vertical scroll (see in the first message).

That take me much time, because the "standard" scrollbar in Autoit do not correspond to my idea. Mine is less complete (no drag the cursor, cursor size is fixe), but it is more adapted to the grid input.

Also, I lost time, before found $WS_EX_CONTROLPARENT in the GUI-child (without it, {TAB} do not run in a child).

Last point (for the moment), use grid input only with few lines. If >250, that become slow...

*** sorry for my bad english ***




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users