I want to have on Gui panel table like in Excel. Is this possible? To be able to change text in cells, copy paste text to raw, columns or cells
Example (table with 3 rows and 2 columns / Parameters should be fixed / Value can be changed before submit)
Parameter / Value
Name Sio
Surname Neil
Phone 363
I tested Edit box and Listview but non of this is ok. I wanna avoid to have 3 separate edit boxes as I can not just paste the whole column at once.
If I use one Edit box then it is not possible to just copy the desired column only.
Listview allows just to view such table but does not allow to modify the content of the cells like in excel.
Some advice?
Table in Gui?
Re: Table in Gui?
You can use LV_InCellEdit by just me here https://autohotkey.com/boards/viewtopic.php?f=6&t=1076
Lintalist: website - source (github)
Re: Table in Gui?
Hello
This is a very good question to me since I was in need to do that too for a wannabe accounting simple software.
I hace chosen the Edit and ComboxBox option that you prefer not to use for understandable reasons.
But I am confident that you can acheive your results with this.
It will need customization for EVERY command you wanna create. So you will need to think of how to do one particular task.
If you want to copy everything from a colomn you would jeed to know in ehat colum you are and then getting values of all controls that contain the coloum number.
If you want to copy a line you would jeed to know in which row you are (when trigerring the copy) and then retrive all values from controls with that row number in their names.
To paste it would be the same thing. You jeed to know in what row and colum you are positionned and then evaluate whats inside your custom clipboard to know How you want to distribute the individual values.
Just to give you some hope... i am able to do all I want with efforts and A LOT of trial and error (plus many readings of help file and questions on the forums)
Once you get it working it will be very easy to perfect to your absolute preferences because it will be your own artifical intelligence that animate the table you built
This is a very good question to me since I was in need to do that too for a wannabe accounting simple software.
I hace chosen the Edit and ComboxBox option that you prefer not to use for understandable reasons.
But I am confident that you can acheive your results with this.
It will need customization for EVERY command you wanna create. So you will need to think of how to do one particular task.
If you want to copy everything from a colomn you would jeed to know in ehat colum you are and then getting values of all controls that contain the coloum number.
If you want to copy a line you would jeed to know in which row you are (when trigerring the copy) and then retrive all values from controls with that row number in their names.
To paste it would be the same thing. You jeed to know in what row and colum you are positionned and then evaluate whats inside your custom clipboard to know How you want to distribute the individual values.
Just to give you some hope... i am able to do all I want with efforts and A LOT of trial and error (plus many readings of help file and questions on the forums)
Once you get it working it will be very easy to perfect to your absolute preferences because it will be your own artifical intelligence that animate the table you built
Re: Table in Gui?
My goal was to maximize the ergonomy of my software - the most user-friendly and quick process. I like the last comment from DRocks: "Once you get it working it will be very easy to perfect to your absolute preferences because it will be your own artifical intelligence that animate the table you built" and I see a few ways how to achieve my goal. Thinking to start just using edit box.
Thanks a lot anyway.
Thanks a lot anyway.
Re: Table in Gui?
I feel like just showing you how my table is first generated as an example to help think of your own (surely better and cleaner method than mine)
I know this is a visual mess, I'm not experimented in coding to date. But for what its worth, this is the initial creation of the controls when I and in the auto-execute portion of the script.
You can see that theres a part with lots of variables and these are how I made it end-up simple to modify. As it currently is, you can modify the number of colomns and rows, and most importantly the width % of each column in the table max width.
Please note that this is just the table itself and it won't navigate intelligently just with that. I have used combination of #if Conditionnal Hotkeys and WM_KEYDOWN messages to create the interactive part.
For example, the enter button now detects what field is invalid and automatically focus it, else if all is valid, it focuses the button to accept and save values.
Hope this helps you think of better solutions and please feel free to share them to me
Code: Select all
;=============================================================================================================================================
;[2.3-!!!-TABLE calcul]
;=============================================================================================================================================
/*;----------------------------------------------------------------------------------------------------------
; TRANSACTION CALCULATION TABLE - ADJUST OFFSET FOR EVERYTHING HERE
;----------------------------------------------------------------------------------------------------------
; "TABLE_X_MARGIN" DETERMINE LA MARGE GAUCHE-DROITE DES CONTROLES DANS LA TABLE. EX: EN DIMINUANT CE CHIFFRE, LA TABLE PRENDRA PLUS DE LARGEUR TOTALE
; "TABLE_COLUMN_COUNT" EST LE NOMBRE PAR LEQUEL LES PROPORTIONS SONT DIVISEES. EX: EN AJOUTANT +1 CHAQUE CONTROLE DIMINUERA PROPORTIONELLEMENT.
;
; ADJUST THE WIDTH RATIO HERE FOR EACH ROUND FUNCTION
; MOVE VARIABLES UNDER OR ABOVE ANOTHER TO CHANGE ORDER OF TAB. THE FIRST BEING LEFT MOST
*/
TABLE_X_MARGIN:=23, TABLE_COLUMN_COUNT:=6, TABLE_X_INCREMENT:=-1, TABLE_EDIT_H_INCREMENT:=-1, TABLE_TITLES_Y:=204, TABLE_TITLES_H:=40 ;y titles 204 ; h31
, TABLE_WIDTH:=(GW+TABLE_COLUMN_COUNT) - (TABLE_X_MARGIN*2), TABLE_PROPORTIONS:=TABLE_WIDTH/TABLE_COLUMN_COUNT, Prev_CONTROL_X:=0
, DEPENSES_SOUSTOTAL_text_X:= ROUND( (GW/2) - ((90 + 100)/2), 2), DEPENSES_SOUSTOTAL_X:= ROUND( DEPENSES_SOUSTOTAL_text_X + 100, 2)
;TABLE_WIDTH FORMULA: LARGEUR DU GUI +NOMBRE DE COLONNE (CAR À CHAQUE POSITIONNEMENT DE COLONNE LE X_INCREMENT EST -1,
;CE QUI DONNE 1 DE LARGEUR DISPONIBLE EN PLUS À CHAQUE COLONNE QUI EXISTE. SI ON AVAIT 7 COLONNE IL Y AURAIT 7PX DE PLUS LARGE DISPONIBLE À PARTAGER EN LES COLONNES)
; POURCENTAGE DE LA TABLE TOTALE :
, MONTANT_W_RATIO:= 13 ;%
, MONTANT_W:=ROUND(((MONTANT_W_RATIO*TABLE_PROPORTIONS)/100*6))
, MONTANT_X:=TABLE_X_MARGIN + Prev_CONTROL_X, Prev_CONTROL_X:=Prev_CONTROL_X + MONTANT_W + TABLE_X_INCREMENT
, CODETAXE_W_RATIO:= 9 ;%
, CODETAXE_W:=ROUND(((CODETAXE_W_RATIO*TABLE_PROPORTIONS)/100*6)) ; EN POURCENTAGE DE LA TABLE TOTALE
, CODETAXE_X:= TABLE_X_MARGIN + Prev_CONTROL_X, Prev_CONTROL_X:=Prev_CONTROL_X + CODETAXE_W + TABLE_X_INCREMENT
, TPS_W_RATIO:= 10 ;%
, TPS_W:=ROUND(((TPS_W_RATIO*TABLE_PROPORTIONS)/100*6)) ; EN POURCENTAGE DE LA TABLE TOTALE
, TVQ_W_RATIO:= 10 ;%
, TVQ_W:=ROUND(((TVQ_W_RATIO*TABLE_PROPORTIONS)/100*6)) ; EN POURCENTAGE DE LA TABLE TOTALE
, TPS_X:=TABLE_X_MARGIN + Prev_CONTROL_X, Prev_CONTROL_X:=Prev_CONTROL_X + TPS_W + TABLE_X_INCREMENT, DEPENSE_TPS_TVQ_LINK_X:= Prev_CONTROL_X
, TVQ_X:=TABLE_X_MARGIN + Prev_CONTROL_X, Prev_CONTROL_X:=Prev_CONTROL_X + TVQ_W + TABLE_X_INCREMENT
, TYPE_W_RATIO:= 23 ;%
, TYPE_W:=ROUND(((TYPE_W_RATIO*TABLE_PROPORTIONS)/100*6)) ; EN POURCENTAGE DE LA TABLE TOTALE
, TYPE_X:=TABLE_X_MARGIN + Prev_CONTROL_X, Prev_CONTROL_X:=Prev_CONTROL_X + TYPE_W + TABLE_X_INCREMENT
, COMMENTAIRE_W_RATIO:= 35 ;%
, COMMENTAIRE_W:=ROUND(((COMMENTAIRE_W_RATIO*TABLE_PROPORTIONS)/100*6)) ; EN POURCENTAGE DE LA TABLE TOTALE
, COMMENTAIRE_X:=TABLE_X_MARGIN + Prev_CONTROL_X, Prev_CONTROL_X:=Prev_CONTROL_X + COMMENTAIRE_W + TABLE_X_INCREMENT
;TxList:="|QC -->| QC in <--|CAN -->| CAN in <--|ON -->| ON in <--"
TxList=
(Join|
QC -->
QC in <--
CAN -->
CAN in <--
ON -->
ON in <--
)
TyList=
(Join|
5190 Sous-contrats
5200 Achat matériel construction
5201 Achat produits pour revendre
5300 Frais de transport
5610 Intérêt et frais bancaires
5625 Assurance responsabilité
5630 Dons
5640 Réparation et entretien
5646 Formation professionnelle
5650 Frais de représentation
5685 Honoraires professionnels
5690 Licences, droits d'affaires
5700 Fournitures
5701 Location équipement
5703 Assurance bureau
5704 Chauffage bureau
5705 Électricité bureau
5706 Entretien bureau
5715 Loyer
5716 Taxes mun. et scolaires
5720 Frais de déplacement
5721 Stationnement
5722 Entretien véhicule
5723 Essences
5724 Immatriculation, permis
5725 Assurance véhicule
5731 Location véhicule
5740 Uniformes de travail
5750 Poste et papeterie
5751 Bureautique
5760 Télécommunication
5765 Publicité, promotion
5784 Frais de voyages
)
;----------------------------------------------------------------------------------------------------------
;TABLE TITLES:
;----------------------------------------------------------------------------------------------------------
Gui Font
Gui Font, s10 q5
Gui Add, Text,% "vMt_TITLE x"MONTANT_X " Y" TABLE_TITLES_Y " w"MONTANT_W " H"TABLE_TITLES_H " +0x200 +Center +Border 0x4 SECTION",MONTANT ($)
Gui Add, Text,% "vTx_TITLE X"CODETAXE_X " YS w"CODETAXE_W " H"TABLE_TITLES_H " +0x200 +Center +Border 0x4", TAXE (`%)
Gui Add, Text,% "vTs_TITLE x"TPS_X " YS w"TPS_W " H"TABLE_TITLES_H " +0x200 +Center +Border 0x4", TPS/TVH
Gui Add, Text,% "vTq_TITLE X"TVQ_X " YS w"TVQ_W " H"TABLE_TITLES_H " +0x200 +Center +Border 0x4", TVQ
Gui Add, Text,% "vTy_TITLE x"TYPE_X " YS W"TYPE_W " H"TABLE_TITLES_H " +0x200 +Center +Border 0x4", TYPE D'ACHAT
Gui Add, Text,% "vCm_TITLE x"COMMENTAIRE_X " YS W"COMMENTAIRE_W " H"TABLE_TITLES_H " +0x200 +Center +Border 0x4", COMMENTAIRE
;----------------------------------------------------------------------------------------------------------
;#[2.3-!!! TABLE CALCUL !!!]
; RANGÉES
;----------------------------------------------------------------------------------------------------------
Loop, 5
{
if (A_Index = 1) {
Visibility:="", Status:="Disabled"
} else {
Status:="Disabled", Visibility:="Hidden"
}
Gui Font
Gui Font, s10 q5
; MONTANT
Gui Add, Edit, %Status% vMt_%A_Index% g1_MONTANT x%MONTANT_X% Y+%TABLE_EDIT_H_INCREMENT% w%MONTANT_W% h21 %Visibility% +Right SECTION ;, 100
; CODETAXE
Gui Font
Gui Font, s8 q5
Gui Add, ComboBox, %Status% hwndhTx_%A_Index% vTx_%A_Index% g2_CODETAXE X%CODETAXE_X% YS w%CODETAXE_W% %Visibility% limit5 R0, %TxList%
;SendMessage, 0x160, % CODETAXE_W + TPS_W + TVQ_W + (TYPE_W/2.4) , , , % "ahk_id " hTx_%A_Index% ;CB_SETDROPPEDWIDTH = 0x160
GetComboBoxInfo(hTx_%A_Index%, CbInfo)
hTx_Edit%A_Index% := NumGet(CbInfo, 40 + PtrSize, PtrType)
Gui, font
Gui Font, s10 q5
; TPS
Gui Add, Edit, %Status% vTs_%A_Index% g3_TPS_ x%TPS_X% YS w%TPS_W% h21 %Visibility%
; TVQ
Gui Add, Edit, %Status% vTq_%A_Index% g4_TVQ_ X%TVQ_X% YS w%TVQ_W% h21 %Visibility%
; TYPE
Gui Font
Gui Font, s8 q5
Gui Add, ComboBox,%Status% hwndhTy_%A_Index% vTy_%A_Index% g5_Type x%TYPE_X% YS W%TYPE_W% h21 %Visibility% R15, %TyList% ;5700 Fournitures|5800 Télécommunication|5900 Essences
Gui Font
; COMMENTAIRE
Gui Font
Gui Font, s8 q5
Gui Add, Edit, %Status% vCm_%A_Index% g6_COMMENT x%COMMENTAIRE_X% YS W%COMMENTAIRE_W% h21 %Visibility% limit61 ;, Test un Deux trois: 1,2,3
}
Visibility:= ,Status:=
You can see that theres a part with lots of variables and these are how I made it end-up simple to modify. As it currently is, you can modify the number of colomns and rows, and most importantly the width % of each column in the table max width.
Please note that this is just the table itself and it won't navigate intelligently just with that. I have used combination of #if Conditionnal Hotkeys and WM_KEYDOWN messages to create the interactive part.
For example, the enter button now detects what field is invalid and automatically focus it, else if all is valid, it focuses the button to accept and save values.
Hope this helps you think of better solutions and please feel free to share them to me
Re: Table in Gui?
Hi DRocks, could you give a fully working example of code?
All I get when I try to run this is "Call to nonexistent function GetComboBoxInfo".
I'm interested in this for, but maybe you could post a completely self-standing bit of code that we can play with and test? Thanks!
All I get when I try to run this is "Call to nonexistent function GetComboBoxInfo".
I'm interested in this for, but maybe you could post a completely self-standing bit of code that we can play with and test? Thanks!
Re: Table in Gui?
Hi, I remember seeing DigiDon doing some highspeed stuff with tables in RichEdit. Perhaps it's another option that you can pursue.
https://www.autohotkey.com/boards/viewt ... le#p235251
https://www.autohotkey.com/boards/viewt ... le#p235251
Re: Table in Gui?
Thanks a lot ... I will definitely look for the proposals and come back when I have something interesting.
Who is online
Users browsing this forum: Google [Bot], roysubs and 181 guests