GUI csv statistics Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
valcon_yf
Posts: 12
Joined: 04 Sep 2022, 08:12

GUI csv statistics

24 Jul 2023, 13:08

Hello
I am working to my GUI CSV STATISTICS, but i am bad at chart in gui and nice design. (I wanna keep all the code in one ahk file)
I need professional help, if someone want to join project?
it will be really nice to have possibility to change the graph design by right click or add a customization menu.
I need export menu to excel, export all 13 file in one. To export graphs.

Or is better to make a menu to go to graph gui and display them there?

Open to ideas!

Code: Select all

;=========================================================================================================================================;
;REV//GLOBAL//MENU
;=========================================================================================================================================;

;12-Jul-23/r00:Creating the script.
;19-Jul-23/r00:Change the order of events;add 2nd srch bar;add grid MLV2.
;21-Jul-23/r00:Change background;addICO;addLogo;add MLV3;FillMLV2;FillMLV3;remove Fill;
;24-Jul-23/r00:Add splashtxt FillMLV2;add timer+gui FillMLV2;
PassedCount := 0
OpenCount := 0
ArcCount := 0
ShortCount := 0
Menu, tray, icon, %A_ScriptDir%\Pictures\TQT8.png
Menu, tray, NoStandard                                                   ;[revent Open, pause script, Suspend Hotkey, Exit menu]
Menu, tray, add, Exit, Closeall                                          ;[In case i wanna put Exit to Tray meniu]
Menu, Tray, Tip , TQT-Interface`nRev:00`nAuthor:Valcon`nUpdate:24.07.23

;=========================================================================================================================================;
;AutoHotKey Environment Settings/ Auto-Execute
;=========================================================================================================================================;

;#Include Win10_Gui.ahk      ;[GUI change design, not tested]
;#Include gdip_all.ahk       ;[This hellps with GIF inside GUI]
;#SingleInstance, Force       ;[Allow only one running instance of script]
;#Persistent                 ;[Keep the script permanently running until terminated]
;#NoEnv                      ;[Avoid checking empty variables for environment variables]
;#Warn                       ;[Enable warnings to assist with detecting common errors]
;#NoTrayIcon                 ;[Disable the tray icon of the script]
SendMode Input               ;[Recommended for new script due to its superior speed and reliability]
SetWorkingDir, %A_ScriptDir% ;[Set the working directory of the script]
SetBatchLines, -1            ;[The speed at which the lines of the script are executed]
;SetTitleMatchMode, 2        ;[Set the title match mode to match any window title containing the specified text]
;SetWinDelay,-1              ;[The delay to occur after modifying a window]
;SetControlDelay,-1          ;[The delay to occur after modifying a control]
;OnExit("OnUnload")          ;[Run a subroutine or function when exiting the script]

;=========================================================================================================================================;
;AutoHotKey Start/Reload/Exit
;=========================================================================================================================================;

{
^+x::exitapp
^+Q::suspend
Return
^+R:: reload
SoundBeep, 750, 400
}
Return
^+S::                        ;[Start script command]

;=========================================================================================================================================;
;Initialise & Graphical user interface (GUI)
;=========================================================================================================================================;
;+DPIScale=GUI elements in your script will automatically scale according to the DPI settings of the user's display.
;-Resize=Disables the ability to resize the GUI window by dragging its edges or corners.
;+OwnDialogs=Allows you to define your custom GUI to handle file selection or message box display.
;-AlwaysOnTop=GUI window that does not stay on top of other windows by default.
;-Disabled=Gui command to create a graphical user interface (GUI) window with its controls initially disabled.
;-SysMenu=Exit X, miximize, put in bar.
;+Owner=minimize nice.

Gui,1: -DPIScale -Resize +MaximizeBox -AlwaysOnTop -Disabled +SysMenu +Owner +Caption +Border
LVArray := {}
wa:=A_screenwidth,ha:=A_screenHeight,xx:=120                    ;[Screen size]
;Gui, Add, Picture, Background, %A_ScriptDir%\Pictures\TQT8.png ;[Replace with the path to your image]
Gui,1:Color,Teal,White                                          ;[Teal, Lime]
Gui,1:Font,s13 cBlack,Calibri                                   ;[Text inside the windows]
;------------------------------------------------------------------------------------------------------------------------
TreeRoot = \\10.67.1.22\Testing\Ploiesti\00-ECI\01-ECB-TRANSABILITY\
treerootx:=treeroot
;------------------------------------------------------------------------------------------------------------------------
x:=(wa*1)/xx,y:=(ha*1)/xx,y2:=(ha*30)/xx,w:=(wa*20)/xx,h:=(ha*5)/xx
Gui, Add, TreeView, vMyTreeView   x%x% y%y% w%w% h%h% w%w% backgroundWhite  gMyTreeView ImageList%ImageListID%
;------------------------------------------------------------------------------------------------------------------------
;Search box xy/ wh/ disply text/
x:=(wa*1)/xx,y:=(ha*7)/xx
x:=(wa*1)/xx,y:=(ha*7)/xx,w:=(wa*20)/xx,h:=(ha*2.9)/xx
Gui, Add, Edit,x%x% y%y% w%w% h%h% -hscroll hWndHED1 vSRCH gSearch
SendMessage 0x1501, 10, "SEARCH",, ahk_id %hed1% ;msg to the search bar.
;------------------------------------------------------------------------------------------------------------------------
; Second search box xy/ wh/ display text/
x:=(wa*1)/xx,y:=(ha*11)/xx
x:=(wa*1)/xx,y:=(ha*11)/xx,w:=(wa*20)/xx,h:=(ha*2.9)/xx
Gui, Add, Edit, x%x% y%y% w%w% h%h% -hscroll hWndHED2 vSRCH2 gSearchInFile
SendMessage 0x1501, 10, "SEARCH IN FILE",, ahk_id %hed2% ;msg to the second search bar.
;------------------------------------------------------------------------------------------------------------------------
;MENU MLV1
x:=(wa*1)/xx,y:=(ha*15)/xx,w:=(wa*20)/xx,h:=(ha*45)/xx
Gui, Add, ListView, vMLV1  x%x% y%y% w%w% h%h% backgroundSilver gMLV1  AltSubmit +Grid, ECB|FILE MODIFIED
T1:=(wa*7)/xx,T2:=(wa*12)/xx
LV_ModifyCol(1, "Center " . T1)
LV_ModifyCol(2, "Center " . T2)
;------------------------------------------------------------------------------------------------------------------------
;MENU MLV2
x:=(wa*22)/xx,y:=(ha*1)/xx,w:=(wa*70)/xx,h:=(ha*59)/xx
Gui, Add, ListView, vMLV2  x%x% y%y% w%w% h%h% backgroundSilver gMLV2 AltSubmit +Grid, ECB| ANTENNA| TEST NO| STATE| NAME| PIN1| PIN2| VALUE| TEST END
Gui, Add, Picture, x500 y625 Background, %A_ScriptDir%\Pictures\Yazaki.png
T1:=(wa*5)/xx,T2:=(wa*16)/xx,T3:=(wa*5)/xx,T4:=(wa*5)/xx,T5:=(wa*4)/xx,T6:=(wa*8)/xx,T7:=(wa*8)/xx,T8:=(wa*7)/xx,T9:=(wa*10)/xx
LV_ModifyCol(1, "Center " . T1)
LV_ModifyCol(2, "Center " . T2)
LV_ModifyCol(3, "Center " . T3)
LV_ModifyCol(4, "Center " . T4)
LV_ModifyCol(5, "Center " . T5)
LV_ModifyCol(6, "Center " . T6)
LV_ModifyCol(7, "Center " . T7)
LV_ModifyCol(8, "Center " . T8)
LV_ModifyCol(9, "Center " . T9)
;------------------------------------------------------------------------------------------------------------------------
;MENU MLV3
 x:=(wa*1)/xx,y:=(ha*62)/xx,w:=(wa*20)/xx,h:=(ha*14.5)/xx
Gui, Add, ListView, vMLV3  x%x% y%y% w%w% h%h% backgroundSilver gMLV3  AltSubmit +Grid, STATE|NO
T1:=(wa*7)/xx,T2:=(wa*12)/xx
LV_ModifyCol(1, "Center " . T1)
LV_ModifyCol(2, "Center " . T2)   
;------------------------------------------------------------------------------------------------------------------------
Gui, Add, StatusBar
w1:=(wa*6)/xx,w2:=(wa*9)/xx
SB_SetParts(w1,w2)                                       ;Create three parts in the bar (the third part fills the remaining width).

;=========================================================================================================================================;
;Script
;=========================================================================================================================================;

; Add folders and their subfolders to the tree. Display the status in case loading takes a long time:
SplashTextOn, 250, 25,, LOADING THE FILES...
TreeRoot := RTrim(TreeRoot, "\")                         ;- Remove trailing backslashes, if any.
SplitPath, TreeRoot, TreeRootName, TreeRootDir           ;- Split TreeRoot into TreeRootName and TreeRootDir.
If (TreeRootName)                                        ;- If TreeRootName is not empty
   TreeRootID := TV_Add(TreeRootName, 0, "Expand Icon4") ;-    add it to the TreeView
Else                                                     ;- Else
   TreeRootID := 0                                       ;-    set TreeRootId to zero.
AddSubFoldersToTree(TreeRoot, TreeRootID)                ;- Call AddSubFolders() passing TreeRoot and TreeRootID
TreeRoot := TreeRootDir                                  ;- Set TreeRoot to TreeRootDir.
SplashTextOff
;x:=(wa*.1)/xx,y:=(ha*.1)/xx,GUIw:=(wa*98)/xx,h:=(ha*94)/xx ;Windows in left top corner.
x:=(wa*10)/xx,y:=(ha*10)/xx,GUIw:=(wa*98)/xx,h:=(ha*94)/xx  ;Windows middle screen.
Gui, Show,x%x% y%y% w%GUIw% h%h%, TQT-Interface
Guicontrol,focus,srch
return
;------------------------------------------------------------------------------------------------------------------------
;This function adds to the TreeView all subfolders in the specified folder.
AddSubFoldersToTree(Folder, ParentItemID = 0)
{
    ;- It also calls itself recursively to gather nested folders to any depth.
    Loop %Folder%\*.*, 2  ;- Retrieve all of Folder's sub-folders.
        AddSubFoldersToTree(A_LoopFileFullPath, TV_Add(A_LoopFileName, ParentItemID, "Icon4 Sort"))
;Sort so that underscores and numbers are sorted to top of tree
}
;------------------------------------------------------------------------------------------------------------------------
MyTreeView:
if A_GuiEvent <> S      ;If event other than "select new tree item".
    return              ;Do nothing.
;Otherwise, populate the ListView with the contents of the selected folder.
;First determine the full path of the selected folder:
TV_GetText(SelectedItemText, A_EventInfo)
ParentID := A_EventInfo
Loop                    ;- Build the full path to the selected folder.
  {
    ParentID := TV_GetParent(ParentID)
    if not ParentID  ; No more ancestors.
        break
    TV_GetText(ParentText, ParentID)
    SelectedItemText = %ParentText%\%SelectedItemText%
  }
SelectedFullPath = %TreeRoot%\%SelectedItemText%
;________________________________________________________________________________________________________________________
Gui,1:ListView,MLV1
LV_Delete()
GuiControl, -Redraw, MLV1
FileCount:= 0,TotalSize:= 0
Loop, %SelectedFullPath%\*.*  ; For simplicity, this omits folders so that only files are shown in the ListView.
{
   ;If A_LoopFileExt in bmp,png,jpg          ; show only these extensions
   If A_LoopFileExt in csv
     {
     LV_Add("", A_LoopFileName, A_LoopFileTimeModified,A_LoopFileSize)  ;A_LoopFileTimeModified, A_LoopFileTimeCreated
	 LVArray.Push({1:A_LoopFileName,2:A_LoopFileTimeModified,3:A_LoopFileSize})
     FileCount += 1
     TotalSize += A_LoopFileSize
     }
}
GuiControl, +Redraw, MLV1
LV_ModifyCol(1, "Logical SortAsc")
;- Populate status bar to show info about the currently selected folder:
SB_SetText(FileCount . " files", 1)
SB_SetText(Round(TotalSize / 1024, 1) . " KB", 2)
SB_SetText(SelectedFullPath, 3)
return
;------------------------------------------------------------------------------------------------------------------------
MLV1:
global StartTime ; Define a global variable to store the start time
Gui,1:ListView,MLV1
  RN:=LV_GetNext("C")
  if (rn=0)
    return
if (A_GuiEvent = "Normal")
{
 LV_GetText(C1,a_eventinfo,1)
 StartTime := A_TickCount ; Store the start time before processing
 xxc=%SelectedFullPath%\%C1%
 SplashTextOn, 600, 20,, LOADING THE TABLE...
 ; Display the data inside the selected file in MLV2
 Gui,1:ListView,MLV2
 Gosub, FillMLV2
 ; Count the occurrences of "Arc" and "Short" and update MLV3
 Gui,1:ListView,MLV3
 Gosub, FillMLV3
 SplashTextOff
 ; Calculate the time taken in minutes and seconds
    ElapsedTime := A_TickCount - StartTime
    ElapsedSeconds := ElapsedTime / 1000
    ElapsedMinutes := Floor(ElapsedSeconds / 60)
    ElapsedSecondsRemain := Round(Mod(ElapsedSeconds, 60))
    
    ; Show the elapsed time in minutes and seconds in a message box
    MsgBox, Time taken: %ElapsedMinutes% minutes and %ElapsedSecondsRemain% seconds
}
;------------------------------------------------------------------------------------------------------------------------
MLV2:
Gui,1:default
Gui,1:ListView,MLV2
  RN:=LV_GetNext("C")
  if (rn=0)
    return
if A_GuiEvent = Normal
  {
  LV_GetText(C1,a_eventinfo,1)
  C1=%c1%
  ;try
  ;run,notepad "%SelectedFullPath%\%C1%"
  }
return
;------------------------------------------------------------------------------------------------------------------------
MLV3:
Gui,1:default
Gui,1:ListView,MLV3
RN:=LV_GetNext("C")
if (RN=0)
    return
if A_GuiEvent = Normal
{
    LV_GetText(C1, A_EventInfo, 1)
    C1 = %C1%
	try
    ; Create a string with the extracted data
    FormatTime, currentDateTime, %A_Now%, dddd, MMMM d, yyyy, HH:mm:ss
    DataString =
    (
Export Date: %currentDateTime%
-----------------------------------------------------
        Passed Count: %PassedCount%
        Open Count: %OpenCount%
        Arc Count: %ArcCount%
        Short Count: %ShortCount%
-----------------------------------------------------
    )
    Run, notepad.exe
    Sleep 100                                                 ;[Wait for Notepad to open before sending data]
    WinWaitActive, ahk_class Notepad                          ;[Use ControlSetText to set the text in Notepad]
    ControlGet, hEdit, Hwnd, , Edit1, ahk_class Notepad
    ControlSetText, %hEdit%, %DataString%, ahk_class Notepad
}
return
;________________________________________________________________________________________________________________________
FillMLV2:
LV_Delete()
F1 := xxc
SplitPath, F1, name, dir, ext, name_no_ext, drive
Obj := FileOpen(F1, "r", "UTF-8")
e := Obj.Read()
Obj.Close()
Loop, Parse, e, `n, `r
{
    if (A_Index = 1)
        continue  ; Skip the first row
    x := a_loopfield
    if x =
        break
    C := StrSplit(x, ";")
    C1 := C[1], C2 := C[2], C3 := C[3], C4 := C[4], C5 := C[5], C6 := C[6], C7 := C[7], C8 := C[8], C9 := C[9]
    LV_Add("", name, C1, C2, C3, C4, C5, C6, C7, C8, C9)
}
e =
return
;------------------------------------------------------------------------------------------------------------------------
FillMLV3:
; Count the occurrences of "Arc" and "Short" and update MLV3
PassedCount := 0
OpenCount := 0
ArcCount := 0
ShortCount := 0
FileRead, fileContent, %xxc%
Loop, Parse, fileContent, `n
{
    x := a_loopfield
    C := StrSplit(x, ";")
    C1 := C[1], C2 := C[2], C3 := C[3], C4 := C[4], C5 := C[5], C6 := C[6], C7 := C[7], C8 := C[8], C9 := C[9]

    ; Count the occurrences of "Arc" and "Short" in each line
    if (InStr(x, "Passed"))
        PassedCount++
    if (InStr(x, "Open"))
        OpenCount++
    if (InStr(x, "Arc"))
        ArcCount++
    if (InStr(x, "Short"))
        ShortCount++
}

LV_Delete()
LV_Add("", "Passed", PassedCount)
LV_Add("", "Open", OpenCount)
LV_Add("", "Arc", ArcCount)
LV_Add("", "Short", ShortCount)
return
;________________________________________________________________________________________________________________________
Search:
GuiControlGet,srch
GuiControlGet,srch2
Gui,1:ListView,MLV1
GuiControl, -Redraw, MLV1
LV_Delete()
For Each, CS In LVArray
{
   If (srch != "")
   {
   If (InStr(CS.1,srch) or InStr(CS.2,srch))  ;[search in column-1 and column-2]
   ;If InStr(CS.2,srch)                       
     LV_Add("", CS.1,CS.2,CS.3)
   }
   Else
      LV_Add("", CS.1,CS.2,CS.3)
}
GuiControl, +Redraw, MLV1
Return
;------------------------------------------------------------------------------------------------------------------------
SearchInFile:
GuiControlGet,srch2
Gui,1:ListView,MLV2
GuiControl, -Redraw, MLV2
LV_Delete()
F1 := xxc
SplitPath, F1, name, dir, ext, name_no_ext, drive
Obj := FileOpen(F1, "r", "UTF-8")
e := Obj.Read()
Obj.Close()
Loop, Parse, e, `n, `r
{
    if (A_Index = 1)
        continue  ;[Skip the first row]
    x := a_loopfield
    if x =
        break
    C := StrSplit(x, ";")
    C1 := C[1], C2 := C[2], C3 := C[3], C4 := C[4], C5 := C[5], C6 := C[6], C7 := C[7], C8 := C[8], C9 := C[9]
    If (srch2 != "")
    {
        If (InStr(x, srch2))
            LV_Add("", name, C1, C2, C3, C4, C5, C6, C7, C8, C9)
    }
    Else
        LV_Add("", name, C1, C2, C3, C4, C5, C6, C7, C8, C9)
}
e =
GuiControl, +Redraw, MLV2
Return
;________________________________________________________________________________________________________________________
GuiClose:
reload
return

Closeall:
Exitapp
return
This is my sketch of future project:
IMG_0311.jpeg
Future
IMG_0311.jpeg (1020.07 KiB) Viewed 713 times
This is sample of what design i want to have overall GUI, menu, splashtext, loading:

@Hellbent is good to bitmap designer.
IMG_0312.jpeg
Design of gui I want
IMG_0312.jpeg (100.16 KiB) Viewed 713 times
This are what graphs i love:
IMG_4032.jpeg
Graphic i want
IMG_4032.jpeg (151.67 KiB) Viewed 713 times
valcon_yf
Posts: 12
Joined: 04 Sep 2022, 08:12

Re: GUI csv statistics

24 Jul 2023, 22:44

How the gui looks now:
image001.png
How is now
image001.png (122.33 KiB) Viewed 687 times
More ideas to the design:
IMG_0313.jpeg
More design gui idea
IMG_0313.jpeg (40.61 KiB) Viewed 687 times
Let me know your 💡🙏🏼
valcon_yf
Posts: 12
Joined: 04 Sep 2022, 08:12

Re: GUI csv statistics

25 Jul 2023, 00:07

CSV file inside view, first column.
image.png
image.png (24.42 KiB) Viewed 675 times
User avatar
Hellbent
Posts: 2114
Joined: 23 Sep 2017, 13:34

Re: GUI csv statistics

27 Jul 2023, 01:23

There is a lib for creating charts in the scripts and functions section of the forum ( v1 )
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=105261
I have never tried it but if I needed to make a graph I might have a look.

Other than that, I have no experience making graphs but if I wanted to make a function that returns the pointer to a bitmap ( pBitmap ) of a pie chart this is how I would go about doing it.

.
20230727014637.png
20230727014637.png (74.79 KiB) Viewed 631 times
.

Code: Select all

PieChart( MyGraph , ScaleFactor := 1 , Ring := 0 ){ ;MyGraph = [ Array of objects with a color and value key ] //// MyGraph[ 1 ] := { Color: "0xAARRGGBB" , Value: 1234 }
	
	TotalValue := 0
	for k , v in MyGraph	{
		TotalValue += MyGraph[ k ].Value
	}
	CurrentRotation := 0
	CurrentRate := ""
	pBitmap := Gdip_CreateBitmap( 500 * ScaleFactor , 500 * ScaleFactor ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF22262a" ) , Gdip_FillEllipse( G , Brush , 140 * ScaleFactor , 140 * ScaleFactor , 220 * ScaleFactor , 220 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	
	for k , v in MyGraph	{
		
		Brush := Gdip_BrushCreateSolid( MyGraph[ k ].Color ) 
		, Gdip_FillPie( G , Brush , 145 * ScaleFactor , 145 * ScaleFactor , 210 * ScaleFactor , 210 * ScaleFactor , CurrentRotation , CurrentRate := ( MyGraph[ k ].Value / TotalValue * 360 ) ) 
		, Gdip_DeleteBrush( Brush )
		
		Pen := Gdip_CreatePen( "0xFF000000" , 2 ) 
		, Gdip_DrawPie( G , Pen , 145 * ScaleFactor , 145 * ScaleFactor , 210 * ScaleFactor , 210 * ScaleFactor , CurrentRotation , CurrentRate := ( MyGraph[ k ].Value / TotalValue * 360 ) ) 
		, Gdip_DeletePen( Pen )
	
		CurrentRotation += CurrentRate
	}
	
	CurrentRotation := 0
	CurrentRate := ""
	for k , v in MyGraph	{
		
		CurrentRate := ( MyGraph[ k ].Value / TotalValue * 360 )
		
		Master := New Vector( 10 , 10 )
		Master.SetMag( 130 )
		Master.SetAngle( CurrentRotation + CurrentRate / 2 )
		Master.Add( 250 , 250 )
		
		w := 60
		h := 30
		x := Master.X - w / 2
		y := Master.Y - h / 2
		
		Brush := Gdip_BrushCreateSolid( "0xcc251E21" ) 
		, Gdip_FillRoundedRectangle( G , Brush , x * ScaleFactor , y * ScaleFactor , w * ScaleFactor , h * ScaleFactor , 5 * ScaleFactor ) 
		, Gdip_DeleteBrush( Brush )
		
		value := Round( CurrentRate / 360 * 100 ) "%"
		
		Brush := Gdip_BrushCreateSolid( "0xFFF0F0F0" ) 
		, Gdip_TextToGraphics( G , value , "s" 16 * ScaleFactor " Center vCenter Bold c" Brush " x" x * ScaleFactor " y" y * ScaleFactor  , "Segoe UI" , w * ScaleFactor , h * ScaleFactor ) 
		, Gdip_DeleteBrush( Brush )
	
		
		
		CurrentRotation += CurrentRate
		
	}
	if( Ring ){
		Brush := Gdip_BrushCreateSolid( "0xFF22262a" ) , Gdip_FillEllipse( G , Brush , ( 250 - Ring / 2 ) * ScaleFactor , ( 250 - Ring / 2 ) * ScaleFactor , ( Ring ) * ScaleFactor , ( Ring ) * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	
	}
	Gdip_DeleteGraphics( G )
	return pBitmap
}
From there I would pick a way of displaying it based on the target Windows OS being ran.
I would go with a picture control for windows 7 and lower and I would go with a layered window for Windows 8+


Working example with a layered window.

Code: Select all

;****************************************************************************************************************************************************************************
#Include <My Altered GDIP lib> ;GDIP:  https://www.autohotkey.com/boards/viewtopic.php?f=6&t=6517
;~ #Include <PopUpWindow_V2> ; At the bottom of the script 
;~ #Include <HB Vectors v2>  ; At the bottom of the script
;****************************************************************************************************************************************************************************
#SingleInstance, Force
SetBatchLines, -1
Gdip_Startup()

;************************************************************
MyGraph := []
MyGraph[ 1 ] := { Value: 125 , Color: "0xFF00FF00" }
MyGraph[ 2 ] := { Value: 22 , Color: "0xFFFFFF00" }
MyGraph[ 3 ] := { Value: 222 , Color: "0xFF00FFFF" }

Gui1 := New PopUpWindow( { AutoShow: 1 , X: 0 , Y: "Center" , W: 500 , H: 500 , Options: " +AlwaysOnTop -DPIScale " } ) 
Gui1.DrawBitmap( HB_BITMAP_MAKER( MyGraph , ScaleFactor := 1 ) , { X: 0 , Y: 0 , W: Gui1.W , H: Gui1.H } , dispose := 1 , AutoUpdate := 1 )


;**************************************************************
MyGraph := []
MyGraph[ 1 ] := { Value: 2567 , Color: "0xFF00FF00" }
MyGraph[ 2 ] := { Value: 1345 , Color: "0xFFFFFF00" }
MyGraph[ 3 ] := { Value: 5656 , Color: "0xFF00FFFF" }
MyGraph[ 4 ] := { Value: 433 , Color: "0xFF0000FF" }
MyGraph[ 5 ] := { Value: 2765 , Color: "0xFFFF0000" }

ScaleFactor := 2
Ring := 80
Gui1 := New PopUpWindow( { AutoShow: 1 , X: 330 , Y: "Center" , W: 500 * ScaleFactor , H: 500 * ScaleFactor , Options: " +AlwaysOnTop -DPIScale " } ) 
Gui1.DrawBitmap( HB_BITMAP_MAKER( MyGraph , ScaleFactor , Ring ) , { X: 0 , Y: 0 , W: Gui1.W , H: Gui1.H } , dispose := 1 , AutoUpdate := 1 )

;********************************************************************
MyGraph := []
MyGraph[ 1 ] := { Value: 2567 , Color: "0xFF00FF00" }
MyGraph[ 2 ] := { Value: 1345 , Color: "0xFFFF0000" }


ScaleFactor := 0.7
Gui1 := New PopUpWindow( { AutoShow: 1 , X: 300 , Y: 100 , W: 500 * ScaleFactor , H: 500 * ScaleFactor , Options: " +AlwaysOnTop -DPIScale " } ) 
Gui1.DrawBitmap( HB_BITMAP_MAKER( MyGraph , ScaleFactor ) , { X: 0 , Y: 0 , W: Gui1.W , H: Gui1.H } , dispose := 1 , AutoUpdate := 1 )

return
GuiClose:
GuiContextMenu:
*ESC::ExitApp

;~ RALT::PopUpWindow.Helper()

HB_BITMAP_MAKER( MyGraph , ScaleFactor := 1 , Ring := 0 ){ ;MyGraph = [ Array of objects with a color and value key ] //// MyGraph[ 1 ] := { Color: "0xAARRGGBB" , Value: 1234 }
	
	TotalValue := 0
	for k , v in MyGraph	{
		TotalValue += MyGraph[ k ].Value
	}
	CurrentRotation := 0
	CurrentRate := ""
	pBitmap := Gdip_CreateBitmap( 500 * ScaleFactor , 500 * ScaleFactor ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF22262a" ) , Gdip_FillEllipse( G , Brush , 140 * ScaleFactor , 140 * ScaleFactor , 220 * ScaleFactor , 220 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	
	for k , v in MyGraph	{
		
		Brush := Gdip_BrushCreateSolid( MyGraph[ k ].Color ) 
		, Gdip_FillPie( G , Brush , 145 * ScaleFactor , 145 * ScaleFactor , 210 * ScaleFactor , 210 * ScaleFactor , CurrentRotation , CurrentRate := ( MyGraph[ k ].Value / TotalValue * 360 ) ) 
		, Gdip_DeleteBrush( Brush )
		
		Pen := Gdip_CreatePen( "0xFF000000" , 2 ) 
		, Gdip_DrawPie( G , Pen , 145 * ScaleFactor , 145 * ScaleFactor , 210 * ScaleFactor , 210 * ScaleFactor , CurrentRotation , CurrentRate := ( MyGraph[ k ].Value / TotalValue * 360 ) ) 
		, Gdip_DeletePen( Pen )
	
		CurrentRotation += CurrentRate
	}
	
	CurrentRotation := 0
	CurrentRate := ""
	for k , v in MyGraph	{
		
		CurrentRate := ( MyGraph[ k ].Value / TotalValue * 360 )
		
		Master := New Vector( 10 , 10 )
		Master.SetMag( 130 )
		Master.SetAngle( CurrentRotation + CurrentRate / 2 )
		Master.Add( 250 , 250 )
		
		w := 60
		h := 30
		x := Master.X - w / 2
		y := Master.Y - h / 2
		
		Brush := Gdip_BrushCreateSolid( "0xcc251E21" ) 
		, Gdip_FillRoundedRectangle( G , Brush , x * ScaleFactor , y * ScaleFactor , w * ScaleFactor , h * ScaleFactor , 5 * ScaleFactor ) 
		, Gdip_DeleteBrush( Brush )
		
		value := Round( CurrentRate / 360 * 100 ) "%"
		
		Brush := Gdip_BrushCreateSolid( "0xFFF0F0F0" ) 
		, Gdip_TextToGraphics( G , value , "s" 16 * ScaleFactor " Center vCenter Bold c" Brush " x" x * ScaleFactor " y" y * ScaleFactor  , "Segoe UI" , w * ScaleFactor , h * ScaleFactor ) 
		, Gdip_DeleteBrush( Brush )
	
		
		
		CurrentRotation += CurrentRate
		
	}
	if( Ring ){
		Brush := Gdip_BrushCreateSolid( "0xFF22262a" ) , Gdip_FillEllipse( G , Brush , ( 250 - Ring / 2 ) * ScaleFactor , ( 250 - Ring / 2 ) * ScaleFactor , ( Ring ) * ScaleFactor , ( Ring ) * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	
	}
	Gdip_DeleteGraphics( G )
	return pBitmap
}

;************
;Vector Class
;**************************************************************************************************************************************************************************
;00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 
;00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 
;00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 
;**************************************************************************************************************************************************************************
Class Vector	{
	;Written By: HB
	;Date: Sept 23rd, 2022
	;Last Edit: Sept 24th, 2022
	;Purpose: Vector math class 
	;Credit: Rohwedder 
	;Resources: 
		;Line intercept concepts and code: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=37175
		;Create an Arrow: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=92039&p=479129#p478944
		;Getting an angle: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=108760&p=483661#p483678
		;Setting an Angle: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=108760&p=483786#p483811
		;
		
	static RadToDeg := 45 / ATan( 1 ) 
		, DegToRad := ATan( 1 ) / 45 
		
	__New( x := 0 , y := 0 , rotate := 0 ){ 
		if( IsObject( x ) ){
			if( rotate = 3 ){
				This.X := x.X * -1
				,This.Y := x.Y * -1
			}else if( rotate = 2 ){
				This.X := x.Y 
				,This.Y := x.X * -1
			}else if( rotate = 1 ){
				This.X := x.Y * -1
				,This.Y := x.X 
			}else{
				This.X := x.X
				,This.Y := x.Y
			}
		}else{
			if( rotate = 3 ){
				This.X := X * -1
				,This.Y := Y * -1
			}else if( rotate = 2 ){
				This.X := Y 
				,This.Y := X * -1
			}else if( rotate = 1 ){
				This.X := Y * -1
				,This.Y := X 
			}else{
				This.X := X
				,This.Y := Y
			}
		}
	}
	Add( x , y := "" ){
		if( IsObject( x ) ){
			This.X += x.X
			,This.Y += x.Y
		}else if( y = "" ){
			This.X += x 
			,This.Y += x
		}else{
			This.X += x 
			,This.Y += y 
		}
	}
	Sub( x , y := "" ){
		if( IsObject( x ) ){
			This.X -= x.X
			,This.Y -= x.Y
		}else if( y = "" ){
			This.X -= X
			,This.Y -= X
		}else{
			This.X -= X
			,This.Y -= Y
		}
	}
	Div( x , y := "" ){
		if( IsObject( x ) ){
			This.X /= x.X
			,This.Y /= x.Y
		}else if( x && y = "" ){
			This.X /= x 
			,This.Y /= x 
		}else{
			This.X /= X
			,This.Y /= Y
		}
	}
	Mult( x , y := "" ){
		if( IsObject( x ) ){
			This.X *= x.X
			,This.Y *= x.Y
		}else if( x && y = "" ){
			This.X *= x 
			,This.Y *= x 
		}else{
			This.X *= X
			,This.Y *= Y
		}
	}
	Dist( x , y := "" ){
		if( IsObject( x ) )
			return Sqrt( ( ( This.X - x.X ) **2 ) + ( ( This.Y - x.Y ) **2 ) )
		else 
			return Sqrt( ( ( This.X - X ) **2 ) + ( ( This.Y - Y ) **2 ) )
	}
	GetMag(){
		return Sqrt( This.X * This.X + This.Y * This.Y )
	}
	SetMag( magnitude ){
		local m := This.GetMag()
		This.X := This.X * magnitude / m
		,This.Y := This.Y * magnitude / m
	}
	MagSq(){
		return This.GetMag()**2
	}	
	Dot( x , y := "" ){
		if( IsObject( x ) )
			return ( This.X * x.X ) + ( This.Y * x.Y )
		else
			return ( This.X * X ) + ( This.Y * Y )
	}
	Cross( x , y := "" ){
		if( IsObject( x ) )
			return This.X * x.Y - This.Y * x.X
		else
			return This.X * Y - This.Y * X
		
	}
	Norm(){
		local m := This.GetMag()
		This.X /= m
		This.Y /= m
	}
	GetAngle(){ 
		local angle 
		( (  angle := Vector.RadToDeg * DllCall( "msvcrt\atan2" , "Double" , This.Y , "Double" , This.X , "CDECL Double" ) ) < 0 ) ? ( angle += 360 )
		return angle
	}
	SetAngle( newAngle := 0 , NewVector := 0 ){
		local Angle := This.GetAngle()
		, ChangeAngle := newAngle - Angle 
		, Co := Cos( Vector.DegToRad * ChangeAngle )
		, Si := Sin( Vector.DegToRad * ChangeAngle )
		, X := This.X 
		, Y := This.Y
		, X2 := X * Co - Y * Si 
		, Y2 := X * Si + Y * Co 
		
		if( !NewVector )
			This.X := X2 , This.Y := Y2
		else 
			return New Vector( X2 , Y2 )
	}
	RotateAngle( rotationAmount := 90 , NewVector := 0 ){
		local Co := Cos( Vector.DegToRad * rotationAmount )
		, Si := Sin( Vector.DegToRad * rotationAmount )
		, X := This.X 
		, Y := This.Y
		, X2 := X * Co - Y * Si 
		, Y2 := X * Si + Y * Co 
		
		if( !NewVector )
			This.X := X2 , This.Y := Y2
		else 
			return New Vector( X2 , Y2 )
	}
	;********************************************
	;class methods
	TestLineInterceptPoint( interceptPoint , Line1 , Line2 ){ ; Line = { Start: { X: , Y: } , End: { X: , Y: } } , interceptPoint = { X: , Y: }
		local
		for k , v in [ "X" , "Y" ]	
			M%v%_Min := min( Line1.Start[ v ] , Line1.End[ v ] )
			,M%v%_Max := max( Line1.Start[ v ] , Line1.End[ v ] )
			,L%v%_Min := min( Line2.Start[ v ] , Line2.End[ v ] )
			,L%v%_Max := max( Line2.Start[ v ] , Line2.End[ v ] )
		if( !( interceptPoint.X < Mx_Min || interceptPoint.X > Mx_Max || interceptPoint.X < Lx_Min || interceptPoint.X > Lx_Max ) && !( interceptPoint.Y < My_Min || interceptPoint.Y > My_Max || interceptPoint.Y < Ly_Min || interceptPoint.Y > Ly_Max ) )
			return 1
		return 0
	}
	GetLineInterceptPoint( Line1 , Line2 ){ ; Line = { Start: { X: , Y: } , End: { X: , Y: } }
		local A1 := Line1.End.Y - Line1.Start.Y
		,B1 := Line1.Start.X - Line1.End.X
		,C1 := A1 * Line1.Start.X + B1 * Line1.Start.Y
		,A2 := Line2.End.Y - Line2.Start.Y
		,B2 := Line2.Start.X - Line2.End.X
		,C2 := A2 * Line2.Start.X + B2 * Line2.Start.Y
		,Denominator := A1 * B2 - A2 * B1 
		return New Vector( { X: ( ( B2 * C1 - B1 * C2 ) / Denominator )  , Y: ( ( A1 * C2 - A2 * C1 ) / Denominator ) } )
	}
	;********************************************
}
;**************************************************************************************************************************************************************************
;00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 
;00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 
;00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 00000 <<<>>> 00000 
;**************************************************************************************************************************************************************************

;####################################################################################################################################################################################
;####################################################################################################################################################################################
;####################################################################################################################################################################################
;####################################################################################################################################################################################
class PopUpWindow	{
;PopUpWindow v2.2
;Date Written: Oct 28th, 2021
;Last Edit: Feb 7th, 2022 :Changed the trigger method.
;Written By: Hellbent aka CivReborn
;SpcThanks: teadrinker , malcev 
	static Index := 0 , Windows := [] , Handles := [] , EditHwnd , HelperHwnd
	__New( obj := "" ){
		This._SetDefaults()
		This.UpdateSettings( obj )
		This._CreateWindow()
		This._CreateWindowGraphics()
		if( This.AutoShow )
			This.ShowWindow( This.Title )
	}
	_SetDefaults(){
		This.X := 10
		This.Y := 10
		This.W := 10
		This.H := 10
		This.Smoothing := 2
		This.Options := " -DPIScale +AlwaysOnTop "
		This.AutoShow := 0
		This.GdipStartUp := 0
		This.Title := ""
		
		This.Controls := []
		This.Handles := []
		This.Index := 0 
	}
	AddTrigger( obj ){
		local k , v , cc , bd
		
		This.Controls[ ++This.Index ] := { 	X:		10
										,	Y:		10
										,	W:		10
										,	H:		10	}
		for k, v in obj
			This.Controls[ This.Index ][ k ] := obj[ k ] 
		cc := This.Controls[ This.Index ]
		Gui, % This.Hwnd ":Add", Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd"
		This.Handles[ hwnd ] := This.Index
		This.Controls[ This.Index ].Hwnd := hwnd
		
		if( IsObject( cc.Label ) ){
			bd := cc.Label
			GuiControl, % This.Hwnd ":+G" , % hwnd , % bd
		}else{
			bd := This._TriggerCall.Bind( This )
			GuiControl, % This.Hwnd ":+G" , % hwnd , % bd
		}
		return hwnd
		
	}
	_TriggerCall(){
		MouseGetPos,,,, ctrl, 2
		Try
			;~ SetTimer, % This.Controls[ This.Handles[ ctrl ] ].Label, -0
			gosub, % This.Controls[ This.Handles[ ctrl ] ].Label
		
				
	}
	DrawTriggers( color := "0xFFFF0000" , AutoUpdate := 0 ){
		local brush , cc 
		Brush := Gdip_BrushCreateSolid( color ) 
		Gdip_SetSmoothingMode( This.G , 3 )
		loop, % This.Controls.Length()	{
			cc := This.Controls[ A_Index ]
			Gdip_FillRectangle( This.G , Brush , cc.x , cc.y , cc.w , cc.h )
		
		}
		Gdip_DeleteBrush( Brush )
		Gdip_SetSmoothingMode( This.G , This.Smoothing )
		if( AutoUpdate )
			This.UpdateWindow()
	}
	UpdateSettings( obj := "" , UpdateGraphics := 0 ){
		local k , v
		if( IsObject( obj ) )
			for k, v in obj
				This[ k ] := obj[ k ]
		( This.X = "Center" ) ? ( This.X := ( A_ScreenWidth - This.W ) / 2 ) 	
		( This.Y = "Center" ) ? ( This.Y := ( A_ScreenHeight - This.H ) / 2 ) 	
		if( UpdateGraphics ){
			This._DestroyWindowsGraphics()
			This._CreateWindowGraphics()
		}
	}
	_CreateWindow(){
		local hwnd
		Gui , New, % " +LastFound +E0x80000 hwndhwnd -Caption  " This.Options
		PopUpWindow.Index++
		This.Index := PopUpWindow.Index
		PopUpWindow.Windows[ PopUpWindow.Index ] := This
		This.Hwnd := hwnd
		PopUpWindow.Handles[ hwnd ] := PopUpWindow.Index
		if( This.GdipStartUp && !PopUpWindow.pToken )
			PopUpWindow.pToken := GDIP_STARTUP()
	}
	_DestroyWindowsGraphics(){
		Gdip_DeleteGraphics( This.G )
		SelectObject( This.hdc , This.obm )
		DeleteObject( This.hbm )
		DeleteDC( This.hdc )
	}
	_CreateWindowGraphics(){
		This.hbm := CreateDIBSection( This.W , This.H )
		This.hdc := CreateCompatibleDC()
		This.obm := SelectObject( This.hdc , This.hbm )
		This.G := Gdip_GraphicsFromHDC( This.hdc )
		Gdip_SetSmoothingMode( This.G , This.Smoothing )
	}
	ShowWindow( Title := "" ){
		Gui , % This.Hwnd ":Show", % "x" This.X " y" This.Y " w" This.W " h" This.H " NA", % Title
	}
	HideWindow(){
		Gui , % This.Hwnd ":Hide",
	}
	UpdateWindow( alpha := 255 ){
		UpdateLayeredWindow( This.hwnd , This.hdc , This.X , This.Y , This.W , This.H , alpha )
	}
	ClearWindow( AutoUpdate := 0 , Color := "" ){
		if( color != "" )
			Gdip_GraphicsClear( This.G , color )
		else
			Gdip_GraphicsClear( This.G )
		if( Autoupdate )
			This.UpdateWindow()
	}
	DrawBitmap( pBitmap , obj , dispose := 1 , AutoUpdate := 0 ){
		Gdip_DrawImage( This.G , pBitmap , obj.X , obj.Y , obj.W , obj.H )
		if( dispose )
			Gdip_DisposeImage( pBitmap )
		if( Autoupdate )
			This.UpdateWindow()
	}
	PaintBackground( color := "0xFF000000" , AutoUpdate := 0 ){
		if( isObject( color ) ){
			Brush := Gdip_BrushCreateSolid( ( color.HasKey( "Color" ) ) ? ( color.Color ) : ( "0xFF000000" ) ) 
			if( color.Haskey( "Round" ) )
				Gdip_FillRoundedRectangle( This.G , Brush , color.X , color.Y , color.W , color.H , color.Round )
			else
				Gdip_FillRectangle( This.G , Brush , color.X , color.Y , color.W , color.H ) 
		}else{
			Brush := Gdip_BrushCreateSolid( color ) 
			Gdip_FillRectangle( This.G , Brush , -1 , -1 , This.W + 2 , This.H + 2 ) 
		}
		Gdip_DeleteBrush( Brush )
		if( AutoUpdate )
			This.UpdateWindow()
	}
	DeleteWindow( GDIPShutdown := 0 ){
		Gui, % This.Hwnd ":Destroy"
		SelectObject( This.hdc , This.obm )
		DeleteObject( This.hbm )
		DeleteDC( This.hdc )
		Gdip_DeleteGraphics( This.G )
		hwnd := This.Hwnd
		for k, v in PopUpWindow.Windows[ Hwnd ]
			This[k] := ""
		PopUpWindow.Windows[ Hwnd ] := ""
		if( GDIPShutdown ){
			Gdip_Shutdown( PopUpWindow.pToken )
			PopUpWindow.pToken := ""
		}
	}
	_OnClose( wParam ){
		if( wParam = 0xF060 ){	;SC_CLOSE ;[ clicking on the gui close button ]
			Try{
				Gui, % PopUpWindow.HelperHwnd ":Destroy"
				SoundBeep, 555
			}
		}
	}
	CreateCachedBitmap( pBitmap , Dispose := 0 ){
		local pCachedBitmap
		if( This.CachedBitmap )
			This.DisposeCachedbitmap()
		DllCall( "gdiplus\GdipCreateCachedBitmap" , "Ptr" , pBitmap , "Ptr" , this.G , "PtrP" , pCachedBitmap )
		This.CachedBitmap := pCachedBitmap
		if( Dispose )
			Gdip_DisposeImage( pBitmap )
	}
	DrawCachedBitmap( AutoUpdate := 0 ){
		DllCall( "gdiplus\GdipDrawCachedBitmap" , "Ptr" , this.G , "Ptr" , This.CachedBitmap , "Int" , 0 , "Int" , 0 )
		if( AutoUpdate )
			This.UpdateWindow()
	}
	DisposeCachedbitmap(){
		DllCall( "gdiplus\GdipDeleteCachedBitmap" , "Ptr" , This.CachedBitmap )
	}
	Helper(){
		local hwnd , MethodList := ["__New","UpdateSettings","ShowWindow","HideWindow","UpdateWindow","ClearWindow","DrawBitmap","PaintBackground","DeleteWindow" , "AddTrigger" , "DrawTriggers", "CreateCachedBitmap" , "DrawCachedBitmap" , "DisposeCachedbitmap" ]
		Gui, New, +AlwaysOnTop +ToolWindow +HwndHwnd
		PopUpWindow.HelperHwnd := hwnd
		Gui, Add, Edit, xm ym w250 r1 Center hwndhwnd, Gui1
		PopUpWindow.EditHwnd := hwnd
		loop, % MethodList.Length()	
			Gui, Add, Button, xm y+1 w250 r1 gPopUpWindow._HelperClip, % MethodList[ A_Index ]
		Gui, Show,,
		OnMessage( 0x112 , This._OnClose.Bind( hwnd ) )
	}
	_HelperClip(){
		local ClipList 
		
		GuiControlGet, out, % PopUpWindow.HelperHwnd ":", % PopUpWindow.EditHwnd	
		
		ClipList := 		{ 	__New: 					" := New PopUpWindow( { AutoShow: 1 , X: 0 , Y: 0 , W: A_ScreenWidth , H: A_ScreenHeight , Options: "" -DPIScale +AlwaysOnTop "" } )"
							,	UpdateSettings:			".UpdateSettings( { X: """" , Y: """" , W: """" , H: """" } , UpdateGraphics := 0 )"
							,	ShowWindow:				".ShowWindow( Title := """" )"
							,	HideWindow:				".HideWindow()"
							,	UpdateWindow:			".UpdateWindow()"
							,	ClearWindow:			".ClearWindow( AutoUpdate := 0 )"
							,	DrawBitmap:				".DrawBitmap( pBitmap := """" , { X: 0 , Y: 0 , W: " Out ".W , H: " Out ".H } , dispose := 1 , AutoUpdate := 0 )"
							,	PaintBackground:		".PaintBackground( color := ""0xFF000000"" , AutoUpdate := 0 )  "  ";{ Color: ""0xFF000000"" , X: 2 , Y: 2 , W: " Out ".W - 4 , H: " Out ".H - 4 , Round: 10 }"
							,	DeleteWindow:			".DeleteWindow( GDIPShutdown := 0 )"
							,	AddTrigger:				".AddTrigger( { X: """" , Y: """" , W: """" , H: """" , Value: """" , Label: """" } )"	
							,	DrawTriggers:			".DrawTriggers( color := ""0xFFFF0000"" , AutoUpdate := 0 )"	
							,	CreateCachedBitmap:		".CreateCachedBitmap( pBitmap , Dispose := 0 )"	
							,	DrawCachedBitmap: 		".DrawCachedBitmap( AutoUpdate := 0 )"	
							,	DisposeCachedbitmap:	".DisposeCachedbitmap()"	}
							
		clipboard := Out ClipList[ A_GuiControl ]
		
	}
}
valcon_yf
Posts: 12
Joined: 04 Sep 2022, 08:12

Re: GUI csv statistics

29 Jul 2023, 00:50

Thank you @Hellbent this is want i needed as example to implement in my code.

When you have time, I have a issue with search bar in interval of time as you saw the csv file, date and time are one big number.

Srch1 looks in MLV1
Srch2 looks in MLV2
Srch3 to look in interval of time display data MLV2

Also, how to make srch1 and 2 to use stars *Arc* to look exactly for some info in csv ?
Thanks 🙏🏼
User avatar
Hellbent
Posts: 2114
Joined: 23 Sep 2017, 13:34

Re: GUI csv statistics

04 Aug 2023, 18:55

valcon_yf wrote:
29 Jul 2023, 00:50
Thank you @Hellbent this is want i needed as example to implement in my code.

When you have time, I have a issue with search bar in interval of time as you saw the csv file, date and time are one big number.

Srch1 looks in MLV1
Srch2 looks in MLV2
Srch3 to look in interval of time display data MLV2

Also, how to make srch1 and 2 to use stars *Arc* to look exactly for some info in csv ?
Thanks 🙏🏼
I'm afraid that I don't really know what you are trying to do.
It sounds like you want to split up a string?

I find this type of task too boring for me so I only do it when I have no choice and in your case I would just look for a predicable pattern and then split the string into new variables. StrSplit() , SubStr() , InStr() , StrLen() are likely the functions I would use???

You should make a new thread asking for help reading your file data because that is something very different then working with a gui.
I hate doing this stuff so much that I have outright refused to learn regEx and you might need to use regEx?
Sorry I can't be of more assistance but I really don't care about file stuff.
valcon_yf
Posts: 12
Joined: 04 Sep 2022, 08:12

Re: GUI csv statistics

05 Aug 2023, 09:41

Hello @Hellbent ,

It is ok, I understand your point. Thanks for sincerity. Much appreciated.
I am using chatgpt and solve a lot of bugs. And doing by myself is pretty cool feeling.

Just I want to ask:
how to improve GUI design?
Should I use bitmap creator?
User avatar
Hellbent
Posts: 2114
Joined: 23 Sep 2017, 13:34

Re: GUI csv statistics  Topic is solved

05 Aug 2023, 18:24

The first thing that you should do is add everything to your window that it is going to need.
Don't worry too much about the layout. Once you have a window that contains everything that it is going to need you can start to think about how you want to position things. If you have everything added and know the sizes of things you can use simple shapes to represent the controls and create mockups of the new layout without having to actually move the controls around.

Once you have the layout that you want worked out you can start to think about upgrading the individual controls for appearance.

For example, if you know that these 3 elements are static and just update with new but predictable string lengths you can use the bitmap maker to create a basic template that contains all the lines you want to partition a window with and then once you export the gdip code from the bitmap maker you can do an edit of the code to replace some of the values with variables. ( If you create a small bitmap with 5 lines spaced 10px apart, you can later edit it to make it 50 lines spaced variable amounts of pixels each )

.
20230805185737.png
20230805185737.png (115.57 KiB) Viewed 467 times
.

.
20230805192246.png
20230805192246.png (80.32 KiB) Viewed 467 times
.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Chunjee, Google [Bot], macromint, peter_ahk and 329 guests