Jump to content

Recommended Posts

Posted

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

Posted

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

Posted (edited)

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
Posted

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
Posted (edited)

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

Br, FireFox.

Edited by FireFox
Posted (edited)

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
Posted (edited)

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
Posted

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.

Posted (edited)

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

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
×
×
  • Create New...