Sign in to follow this  
Followers 0
LibrarianMark

Thumbnails in scrolling box

10 posts in this topic

#1 ·  Posted (edited)

Folks -

I work at a public library and am trying to write a printer interface for the public users. It will include a form that comes up with the number of pages printed, number of copies, total price, print to BW or color, etc. Using the redmonee port direction monitor and ghostscript, I can convert the pages to postscript, jpegs, bitmaps, PDF's, all that works.

I am trying to put bmp images of the pages they want to print in some sort of scrolling control at the bottom of the form so that they can click to select on the pages they don't want to print (see attachment) It's amazing how many web pages print out two pages but the second page is nearly blank and contains nothing useful. I am trying to make is such that patrons don't get to say, "well, I don't want that page, so I'm not paying for it!"

What I had in mind was a scrolling portion of the form that would contain the page images with a check box underneath to select or deselect a page. What "container" should I use? How do I insert the pictures into it? The group box and group of controls don't seem to work - I put images in and they don't show up.

Any ideas?

Thanks!

Library Mark

post-59400-12809329998616_thumb.jpg

Edited by LibrarianMark

Share this post


Link to post
Share on other sites



LibrarianMark,

Welcome to the AutoIt forum. :blink:

Would something like this be what you are looking for? ;)

You need my GUIScrollbars_Ex UDF (you can find it in my sig under Scrollbars) and you will have to put a suitable image in the GUICtrlSetImage line (<<<<<<<<<<<<<<<<<<<<):

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIScrollbars_Ex.au3>

Global $iNumber = 12
Global $aPictureFrames[$iNumber]
Global $aPictureChecks[$iNumber]

$hGUI = GUICreate("Test", 500, 190)
GUISetBkColor(0x0000FF, $hGUI)

$hButton = GUICtrlCreateButton("Print", 210, 150, 80, 30)

$hGUI_Pages = GUICreate("Pages", 480, 130, 10, 10, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)

For $i = 0 To $iNumber - 1
    $aPictureFrames[$i] = GUICtrlCreatePic("", 10 + ($i * 60), 10, 60, 80)
    GUICtrlSetImage(-1, "Sample_Image_Path") ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    $aPictureChecks[$i] = GUICtrlCreateCheckbox("", 30 + ($i * 60), 115, 15, 15)
Next

_GUIScrollbars_Generate ($hGUI_Pages, 10 + ($iNumber * 60))

GUISetState(@SW_SHOW, $hGUI)
GUISetState(@SW_SHOW, $hGUI_Pages)

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton
            $sPrintList = ""
            For $i = 0 To $iNumber - 1
                If GUICtrlRead($aPictureChecks[$i]) = 1 Then $sPrintList &= $i + 1 & " "
            Next
            MsgBox(0, "Pages Selected", $sPrintList)
            Exit
    EndSwitch

WEnd

If this is heading in the right direction, let me know and we can work on how we might get your page images into the various Pic controls. :P

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

Wow - that was fast! Thanks! Yeah, that's what I am looking for. After I posted, I was playing around with _IECreateEmbedded and it looked do-able, but your code beats that by a mile. Let me play a bit with it and I will see what I can learn from it.

Again - Thanks a lot!

Library Mark

Share this post


Link to post
Share on other sites

OK - I can load one image and all the controls show the same image. How would I put a different image on each pic control?

Thanks again - You da MAN!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

OK - I can load one image and all the controls show the same image. How would I put a different image on each pic control?

Thanks again - You da MAN!

Oops - that's what the for loop is for. Silly me. I did name the bitmaps sequentially, so putting $i in the filename works like a champ!

Edited by LibrarianMark

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

LibrarianMark,

Glad you like it! :blink:

What I suggest is that you create your page images and store their paths in an array. Then you can use the array elements as the variable in the GUICtrlSetImage line using the same $i variable as an index. And the return from the GUICtrlRead($aPictureCheck($i)) line will give you the index to refer that image when you come to print.

Does that make sense? ;)

M23

Edit: I see you worked it out yourself!

Edited by Melba23

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

Stupid quick question - how do I make the checkboxes default to checked? Thanks again!

Share this post


Link to post
Share on other sites

LibrarianMark,

Immediately after you create them, put this line:

GUICtrlSetState(-1, $GUI_CHECKED)

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

LibrarianMark,

Immediately after you create them, put this line:

GUICtrlSetState(-1, $GUI_CHECKED)

M23

Thank you very much for everything!

Share this post


Link to post
Share on other sites

LibrarianMark,

My pleasure. :blink:

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
Sign in to follow this  
Followers 0