Jump to content
Sign in to follow this  
incepator

Pic position in form

Recommended Posts

incepator

how to make a algorithm to show my pictures framed Form, one under another 5 per on line?

Thank you!

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <TabConstants.au3>
#include <GDIPlus.au3>
#Include <Memory.au3>
#include <File.au3>
#include <Array.au3>
#include "GUICtrlPic.au3"
#NoTrayIcon
$Form1 = GUICreate("", 1006, 695, -1, -1, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Tab1 = GUICtrlCreateTab(3, 3, 1001, 689)

$all_dir = _FileListToArray(@ScriptDir, "*", 2)
   If IsArray($all_dir) Then
    For $i = 1 To $all_dir[0]
     Global $TabSheet1 = GUICtrlCreateTabItem($all_dir[$i])
      $all_dir2 = _FileListToArray(@ScriptDir&"\"&$all_dir[$i], "*", 2)
      If IsArray($all_dir2) Then
       For $ii = 1 To $all_dir2[0]
        $Button1 = GUICtrlCreateButton($all_dir2[$ii], 24, 30*$ii+7, 171, 22, $WS_BORDER)
        GUICtrlSetCursor (-1, 0)
        _GUICtrlPic_Create(@ScriptDir&"\"&$all_dir[$i]&"\"&$all_dir2[$ii]&"\"&"template_thumbnail.png" , 200, 60*$ii-30, 176, 113, BitOR($SS_CENTERIMAGE,$SS_SUNKEN, $SS_NOTIFY), Default)
        GUICtrlSetTip(-1, $all_dir2[$ii])
       Next
      EndIf
    Next
   EndIf
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd

GUICtrlPic.au3

Share this post


Link to post
Share on other sites
FireFox

Hi,

how to make a algorithm to show my pictures framed Form, one under another 5 per on line?

What? Can you be more specific?

GUICtrlCreatePic(...)

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
incepator

ok...GUICtrlCreatePic..

how to make a algorithm to show my pictures...4 pictures per line and 5 column. ?

post-75717-0-56357000-1350556546_thumb.j

Share this post


Link to post
Share on other sites
FireFox

You can make a use the For statement :

For $iRow = 1 To 5
For $iColumn = 1 To 4
GUICtrlCreatePic(..., $iColumn * $picwidth, $iRow * $picheight, ...)
Next
Next

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
incepator

yes ... it makes sense as you say, only in the context of my script does not work

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <TabConstants.au3>
#include <GDIPlus.au3>
#Include <Memory.au3>
#include <File.au3>
#include <Array.au3>
#include "GUICtrlPic.au3"
#NoTrayIcon
$Form1 = GUICreate("", 1006, 695, -1, -1, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Tab1 = GUICtrlCreateTab(3, 3, 1001, 689)
$all_dir = _FileListToArray(@ScriptDir, "*", 2)
   If IsArray($all_dir) Then
    For $i = 1 To $all_dir[0]
     Global $TabSheet1 = GUICtrlCreateTabItem($all_dir[$i])
      $all_dir2 = _FileListToArray(@ScriptDir&"\"&$all_dir[$i], "*", 2)
      If IsArray($all_dir2) Then
       For $ii = 1 To $all_dir2[0]
        $Button1 = GUICtrlCreateButton($all_dir2[$ii], 24, 30*$ii+7, 171, 22, $WS_BORDER)
        GUICtrlSetCursor (-1, 0)
   For $iRow = 1 To 4
   For $iColumn = 1 To 5
    _GUICtrlPic_Create(@ScriptDir&"\"&$all_dir[$i]&"\"&$all_dir2[$ii]&"\"&"template_thumbnail.jpg" , $iColumn*200, $iRow*120, 176, 113)
   Next
   Next
       Next
      EndIf
    Next
   EndIf
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd

appear exactly images ...

not use $all_dir2[$ii] :(

post-75717-0-35054600-1350558224_thumb.j

Share this post


Link to post
Share on other sites
FireFox

Maybe this : (not tested)

...
Local $iRow = 1, $iColumn = 1

If IsArray($all_dir2) Then
For $ii = 1 To $all_dir2[0]
$Button1 = GUICtrlCreateButton($all_dir2[$ii], 24, 30 * $ii + 7, 171, 22, $WS_BORDER)
GUICtrlSetCursor(-1, 0)
_GUICtrlPic_Create(@ScriptDir & "" & $all_dir[$i] & "" & $all_dir2[$ii] & "" & "template_thumbnail.jpg", $iColumn * 200, $iRow * 120, 176, 113)

$iColumn += 1

If Not Mod($ii, 4) Then ;or $iColumn = 5
$iRow += 1
$iColumn = 1
EndIf
Next
EndIf
...

Edit : Added Not operator.

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
incepator

Perfect !

Congratulations!

it worked, thanks a lot!

Share this post


Link to post
Share on other sites
FireFox

Glad to have helped ;)


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
incepator

How can I add a parameter like this?

to display something you give click the photos displayed.

...................
Select
        Case $pic_create[$ii]
         MsgBox(0,"","Name: "&$pic_create[$ii])
       EndSelect

Share this post


Link to post
Share on other sites
FireFox

I only see one option (or the best which exists), the SetOnEvent UDF by martin, available

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
incepator

I tried like this, I tried with GUICtrlSetOnEvent...but not work, does not show the name to be, $all_dir2[$ii] ..

probably because $all_dir2[$ii] is not an exact variable ...

Edited by incepator

Share this post


Link to post
Share on other sites
FireFox

If I linked the UDF it's because I meant this :

#include "onEventFunc.au3"
...
Local $aPic[UBound($all_dir2)]

$aPic[$ii] = _GUICtrlPic_Create(@ScriptDir & "" & $all_dir[$i] & "" & $all_dir2[$ii] & "" & "template_thumbnail.jpg", $iColumn * 200, $iRow * 120, 176, 113)
SetOnEventA($aPic[$ii], "_picevent", $paramByVal, $ii)
...

Func _picevent($iPicture)
ConsoleWrite($iPicture & @CrLf)
EndFunc

I have set as parameter the picture index, you can set what you want and more parameters.

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
incepator

Not Work...:|

post-75717-0-56067700-1350571777_thumb.j

Share this post


Link to post
Share on other sites
FireFox

Maybe...

...
#NotrayIcon

Opt("GUIOnEventMode", 1)

$Form1 = 
...

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
incepator

I know, I added Eight ("GUIOnEventMode", 1) ...

does not display the name of the picture you clicked

post-75717-0-01155200-1350572385_thumb.j

Edited by incepator

Share this post


Link to post
Share on other sites
FireFox

does not display the name of the picture you clicked

And where is stored the name of the picture, because all have the name "template_thumbnail.jpg".

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
incepator

I'm sorry, I was wrong, I'm not talking about the image names , I mean the name of the folder where the image is displayed.

Posted Image

Posted Image

Posted Image

post-75717-0-91803000-1350583627_thumb.j

Edited by incepator

Share this post


Link to post
Share on other sites
FireFox

SetOnEventA($aPic[$ii], "_picevent", $paramByVal, $all_dir2[$ii])


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
incepator

Thanks, now works properly.

I think I was a stress for you today.

I appreciate a good night!

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  

×