Jump to content
Thingy2nl

GUI with frames and Scrollbar issue.

Recommended Posts

Thingy2nl

Hi all,

I am having some issues with a small proof of concept script.

What this script will need to do in the end is monitor a directory for incoming jpg files. Pick them up and show them to the user while providing the using some options in the right frame  ($iFrame_A, 1) for processing the selected jpg, then clear the screen and start monitoring again.

The two issues i have now are:

1. I can only get GDI to display new images by performing a _GUIFrame_Switch. Turning off the main gui and turning it on again works, but that will blink the screen. So that is not an option. Is there something stupid i'm overlooking?

2. Whenever the number of pictures get to much for the screen size, I would like a scroll bar in the left frame ($iFrame_A, 0), but whatever i try, i can not get a scroll bar to show... again, probably something I am missing....

 

Anyone who can shed some light on this (esp Melba :) )?

 

Short source:

#Region Include
#include <GDIPlus.au3>
#include <File.au3>
#include <GUIFrame.au3>
#include <GUIScrollBars_Ex.au3>
#EndRegion


; Use @DesktopWidth and @DesktopHeight for screen resolution
Local $hMainForm2 = GUICreate("BIS Processing ", @DesktopWidth-200 , @DesktopHeight-200, 100, 100, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
Local $iFrame_A = _GUIFrame_Create($hMainForm2, 0, @DesktopWidth-200-300)
_GUIFrame_ResizeSet(0)

; Start monitoring for pictures
; Just use an fixed dir for now
Local $JPGPath = "C:\Users\admin\Desktop\JPG"
Local $JPGFiles = _FileListToArray( $JPGPath & "\", "*.jpg" )

_GDIPlus_Startup()
GUISetState(@SW_SHOW, $hMainForm2)
;
; Need to use frame switching to force GDI to show pictures
;
_GUIFrame_Switch($iFrame_A, 1)
_GUIFrame_Switch($iFrame_A, 0)
Local $hPic1 = GUICtrlCreatePic($JPGPath & "\" & $JPGFiles[1], 10, 10, 400, 255)
_GUIFrame_Switch($iFrame_A, 1)
_GUIFrame_Switch($iFrame_A, 0)
Local $hPic2 = GUICtrlCreatePic($JPGPath & "\" & $JPGFiles[2], 10, 275, 400, 255)
_GUIFrame_Switch($iFrame_A, 1)
_GUIFrame_Switch($iFrame_A, 0)
Local $hPic3 = GUICtrlCreatePic($JPGPath & "\" & $JPGFiles[3], 10, 540, 400, 255)
_GUIFrame_Switch($iFrame_A, 1)
_GUIFrame_Switch($iFrame_A, 0)
Local $hPic4 = GUICtrlCreatePic($JPGPath & "\" & $JPGFiles[4], 10, 805, 400, 255)
_GUIFrame_Switch($iFrame_A, 1)
_GUIFrame_Switch($iFrame_A, 0)

;
; No scrollbar is showing, can this be done while using frames?
;
local $setbar = _GUIScrollBars_Generate(_GUIFrame_GetHandle($iFrame_A, 0), 0, 1000)

While 1
   Switch GUIGetMsg()
   Case $GUI_EVENT_CLOSE
                  ExitLoop
   EndSwitch
WEnd

 

 

Edited by Melba23
Added code tags

Share this post


Link to post
Share on other sites
Melba23

Thingy2nl,

As the UDFs in question are both mine, I will take a look into the problem this afternoon.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Thingy2nl

Managed to solve the issue.

For some reason, I worked with the notion that frames were assigned 0 and 1... after changing to 1 for left and 2 for the right side.... it al started making a lot more sense. The fact that the handle for frame 0 was always invalid should have triggered me sooner....

Anyway, problem solved.

Thanx for the response Melba and even more Thank You for you great UDF's and support in general!

 

Thing

Share this post


Link to post
Share on other sites
Melba23

Thingy2nl,

Glad you got it sorted - and thanks.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
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

×