LibrarianMark Posted August 4, 2010 Share Posted August 4, 2010 (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 Edited August 4, 2010 by LibrarianMark Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 4, 2010 Moderators Share Posted August 4, 2010 LibrarianMark,Welcome to the AutoIt forum. 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 (<<<<<<<<<<<<<<<<<<<<):expandcollapse popup#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 WEndIf 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. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
LibrarianMark Posted August 4, 2010 Author Share Posted August 4, 2010 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 Link to comment Share on other sites More sharing options...
LibrarianMark Posted August 4, 2010 Author Share Posted August 4, 2010 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! Link to comment Share on other sites More sharing options...
LibrarianMark Posted August 4, 2010 Author Share Posted August 4, 2010 (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 August 4, 2010 by LibrarianMark Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 4, 2010 Moderators Share Posted August 4, 2010 (edited) LibrarianMark,Glad you like it! 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? M23Edit: I see you worked it out yourself! Edited August 4, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
LibrarianMark Posted August 4, 2010 Author Share Posted August 4, 2010 Stupid quick question - how do I make the checkboxes default to checked? Thanks again! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 4, 2010 Moderators Share Posted August 4, 2010 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
LibrarianMark Posted August 4, 2010 Author Share Posted August 4, 2010 LibrarianMark, Immediately after you create them, put this line: GUICtrlSetState(-1, $GUI_CHECKED) M23 Thank you very much for everything! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 4, 2010 Moderators Share Posted August 4, 2010 LibrarianMark, My pleasure. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now