# imageBrowser 1.11 class

**URL:** <https://forum.xojo.com/t/imagebrowser-1-11-class/24858>\
**Category:** Extras\
**Created:** [June 11, 2015, 2:05pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858 "2015-06-11T14:05:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 11, 2015, 2:05pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/1 "2015-06-11T14:05:42Z")

</div>

Hi,

I’d like to present my imageBrowser class and I’d like you guys to check the demo out.

In a nutshell: This class enables you to show any kind of images a scrollable environment featuring:

- auto image scroll
- drag and drop
- drag reorder
- insert/remove animating

and other things.

It’s in pure RB code apart from the fading effects however the only supported platform is still OSX. I’m currently  
working on an optimized Win version but this will take a while.

[![](http://fs1.directupload.net/images/150611/temp/op2s88g7.jpg)](http://www.directupload.net/file/d/4015/op2s88g7_jpg.htm)

[![](http://fs2.directupload.net/images/150611/temp/ddnys62w.jpg)](http://www.directupload.net/file/d/4015/ddnys62w_jpg.htm)

[![](http://fs1.directupload.net/images/150611/temp/gxlw3425.jpg)](http://www.directupload.net/file/d/4015/gxlw3425_jpg.htm)

[imageBrowser Demo 1.0](https://www.dropbox.com/s/kkgpvukpk7d8brk/ImageBrowser_1_0_encrypt.xojo_binary_project?dl=0)

Your feedback is much appreciated.

---

<div class="post-metadata">

**Author:** ![Peter\_Fargo](https://forum.xojo.com/user_avatar/forum.xojo.com/peter_fargo/32/977_2.png) [@Peter\_Fargo](https://forum.xojo.com/u/Peter_Fargo)\
**Post date:** [June 11, 2015, 3:04pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/2 "2015-06-11T15:04:40Z")

</div>

bg\_pattern0 and bg\_pattern1 are missing

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 11, 2015, 5:05pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/3 "2015-06-11T17:05:14Z")

</div>

> [@193531:@Peter Fargo](#):
>
> bg\_pattern0 and bg\_pattern1 are missing

Thanks Peter. You’re right.

[imageBrowser Demo 1.0 /w Textures](https://xojo.io/e81d2e7abcb6)

---

<div class="post-metadata">

**Author:** ![Richard\_Summers](https://forum.xojo.com/user_avatar/forum.xojo.com/richard_summers/32/477_2.png) [@Richard\_Summers](https://forum.xojo.com/u/Richard_Summers)\
**Post date:** [June 11, 2015, 5:10pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/4 "2015-06-11T17:10:23Z")

</div>

Rob,  
Nice work!

Here is what I have noticed after a few minutes playing with it:

1. If you select an image - then click the remove button, the image is removed - all good so far.  
But if you then click on the remove button again, (without selecting another image) - the app crashes.

2. If you press cancel to remove all images, then create a report - then drag the report down - a new report is created - is that supposed to happen?

3. You said it had an auto image scroll feature - how is that activated?  
The only time I can get the images to move is if I click on the arrows?

Also, would be great if this could also be used horizontally 🙂

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 11, 2015, 7:15pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/5 "2015-06-11T19:15:33Z")

</div>

[quote=193561:@Richard Summers]Rob,  
Nice work!

Here is what I have noticed after a few minutes playing with it:

1. If you select an image - then click the remove button, the image is removed - all good so far.  
But if you then click on the remove button again, (without selecting another image) - the app crashes.

2. If you press cancel to remove all images, then create a report - then drag the report down - a new report is created - is that supposed to happen?

3. You said it had an auto image scroll feature - how is that activated?  
The only time I can get the images to move is if I click on the arrows?

Also, would be great if this could also be used horizontally :)[/quote]

Hi Richard,  
Thank you very much for your feedback.

1.) I’ll look into #1. This seems like a bug.  
2.) I should disable this. I actually wanted to insert new dops from outside. Seems like I should check this too. Thanks.  
3.) “auto scroll” should be enabled with the checkbox. Partly visible Icons will be scrolled into visible area up/down. I may rename this feature.

---

<div class="post-metadata">

**Author:** ![Peter\_Fargo](https://forum.xojo.com/user_avatar/forum.xojo.com/peter_fargo/32/977_2.png) [@Peter\_Fargo](https://forum.xojo.com/u/Peter_Fargo)\
**Post date:** [June 11, 2015, 7:28pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/6 "2015-06-11T19:28:54Z")

</div>

Looks good Rob. I did have a couple random crashes while clicking away madly at the options. Very well could have been the app code and not the browser itself.

This would make a great browser for a game’s level editor.

One minor annoyance was the time lag before being able to synch the mouse movement with dragging a selected item.

I would also use the inspector behavior to expose some of the options in the IDE.

Nice job.

---

<div class="post-metadata">

**Author:** ![Richard\_Summers](https://forum.xojo.com/user_avatar/forum.xojo.com/richard_summers/32/477_2.png) [@Richard\_Summers](https://forum.xojo.com/u/Richard_Summers)\
**Post date:** [June 11, 2015, 7:34pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/7 "2015-06-11T19:34:20Z")

</div>

Ahhh - I thought autoscroll caused all the images to continuously scroll, like a scrolling banner on a website 🙂  
If you also made this work horizontally - it would be ideal for scrolling buttons / images / info etc across the bottom of a window.

Keep up the good work - I’m sure lots of people will find this useful.

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 11, 2015, 8:38pm UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/8 "2015-06-11T20:38:28Z")

</div>

[quote=193617:@Peter Fargo]Looks good Rob. I did have a couple random crashes while clicking away madly at the options. Very well could have been the app code and not the browser itself.

This would make a great browser for a game’s level editor.

One minor annoyance was the time lag before being able to synch the mouse movement with dragging a selected item.

I would also use the inspector behavior to expose some of the options in the IDE.

Nice job.[/quote]

Thanks Peter.

I need to revise the code a bit regarding the options. It’s true not all flags work as supposed to (“transparent”).

The dragThreshold is currently 0.5 sec before it’s reconized as a drag not a click. I could lower it and check mouse X,Y corrdinates too. They may help.

Edit: Adjusted threshold to 0.35 sec. Seem a good compromise. Thanks you

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 12, 2015, 1:48am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/9 "2015-06-12T01:48:46Z")

</div>

New release: imageBrowser v1.01 - June 12th

- textures are now inline data
- improved drag bevavior : imageHolder threshold to 0.35sec
- fixed dragitem x,y coprdinates
- removing unselected item doesn’t crash anymore
- scrolling is now possible while drag reordering
- scrolling is now enabled by default for insert and remove
- added imageDragReleased event getting invoked after a drag rerordering
- fixed bug “insert” failed after “clear” call
- added imageInserted event
- added imageRemoved event

[imageBrowser 1.01 Demo](https://xojo.io/22b21b16f812)

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 12, 2015, 8:05am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/10 "2015-06-12T08:05:26Z")

</div>

[quote=193622:@Richard Summers]Ahhh - I thought autoscroll caused all the images to continuously scroll, like a scrolling banner on a website 🙂  
If you also made this work horizontally - it would be ideal for scrolling buttons / images / info etc across the bottom of a window.

Keep up the good work - I’m sure lots of people will find this useful.[/quote]

Hi Richard,

The class being used horizontally will be implemented soon. I’ve made the arrow class  
compatible at the beginning to work towards this feature. However, I wanted to have the base structure with perfect animation at first.

Auto scrolling of the controls like a banner could be easily done but I actually dislike it such as the websites doing this 🙂 but hey if this seems required why not.

---

<div class="post-metadata">

**Author:** ![ChristopheDV](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@ChristopheDV](https://forum.xojo.com/u/ChristopheDV)\
**Post date:** [June 12, 2015, 8:23am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/11 "2015-06-12T08:23:51Z")

</div>

Looks good but for OSX you should use the native Imagebrowser (MBS plugins has this). Works much faster, smoother and flexible.

---

<div class="post-metadata">

**Author:** ![Richard\_Summers](https://forum.xojo.com/user_avatar/forum.xojo.com/richard_summers/32/477_2.png) [@Richard\_Summers](https://forum.xojo.com/u/Richard_Summers)\
**Post date:** [June 12, 2015, 9:57am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/12 "2015-06-12T09:57:35Z")

</div>

Rob,  
Regarding the horizontal scroll option - it’s always better to offer as many options as possible, as every developer has different requirements…

The auto-scroll animation speed could be determined by a slider control 🙂

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 12, 2015, 10:11am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/13 "2015-06-12T10:11:42Z")

</div>

> [@193761:@Christoph De Vocht](#):
>
> Looks good but for OSX you should use the native Imagebrowser (MBS plugins has this). Works much faster, smoother and flexible.

I don’t consider it as a valuable feedback. Sometimes the community makes we wonder…

---

<div class="post-metadata">

**Author:** ![Richard\_Summers](https://forum.xojo.com/user_avatar/forum.xojo.com/richard_summers/32/477_2.png) [@Richard\_Summers](https://forum.xojo.com/u/Richard_Summers)\
**Post date:** [June 12, 2015, 10:20am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/14 "2015-06-12T10:20:40Z")

</div>

Rob,  
what you’re doing is both valuable, and appreciated.

Simply add any additional required features to it over a period of time, and be proud of what you are offering.

🙂

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [June 12, 2015, 10:34am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/15 "2015-06-12T10:34:58Z")

</div>

> [@193778:@Rob Egal](#):
>
> I don’t consider it as a valuable feedback. Sometimes the community makes we wonder…

Don’t let that rain on your parade. Life exists beyond Cocoa declares. Otherwise we would be programming in Objective-C.

Congratulations for what you have accomplished. Looking forward for future developments.

It is great work. Will you be selling the unencrypted class ?

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 13, 2015, 4:48am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/16 "2015-06-13T04:48:30Z")

</div>

Hi folks!

New version out! I can say I am satisfied with v1.02 and my work and will keep implementing features.  
But for now I am going to take a break - gotta sleep.

imageBrowser v1.02 - June 13th, 05:15 AM

- class is works now in vertical/horizontal mode giving it more flexible
- fixed a bug inserting an item at a wrong position
- fixed dragitem x,y coordinates; drag item is now at the most mouseX/Y position.
- optimized code
- optimized animation
- inserted a “lastItem” property referring to the last clicked item
- properties are now shown in the inspector
- returning kClearColor as backgroundColor will make the class transparent
- known issues: PagePanel (horizontal) not yet implemented

[![](http://fs1.directupload.net/images/150613/temp/aviz425v.png)](http://www.directupload.net/file/d/4017/aviz425v_png.htm)  
[![](http://fs1.directupload.net/images/150613/temp/qoroeoz7.png)](http://www.directupload.net/file/d/4017/qoroeoz7_png.htm)

[ImageBrowser v1.02 Demo](https://www.dropbox.com/s/tyeac5ja3bv7wzy/ImageBrowser_1_02_encrypt.xojo_binary_project?dl=0)

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 13, 2015, 4:59am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/17 "2015-06-13T04:59:08Z")

</div>

[quote=193775:@Richard Summers]Rob,  
Regarding the horizontal scroll option - it’s always better to offer as many options as possible, as every developer has different requirements…

The auto-scroll animation speed could be determined by a slider control :)[/quote]

Well noted.

---

<div class="post-metadata">

**Author:** ![Rob\_Egal](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Rob\_Egal](https://forum.xojo.com/u/Rob_Egal)\
**Post date:** [June 13, 2015, 5:06am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/18 "2015-06-13T05:06:53Z")

</div>

[quote=193780:@Michel Bujardet]Don’t let that rain on your parade. Life exists beyond Cocoa declares. Otherwise we would be programming in Objective-C.

Congratulations for what you have accomplished. Looking forward for future developments.

It is great work. Will you be selling the unencrypted class ?[/quote]

Hi Michel,

Thank once again. I’ll need to check what I’ll do with it. Selling might be an option encrpyted/decrypted - yes.

---

<div class="post-metadata">

**Author:** ![ChristopheDV](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@ChristopheDV](https://forum.xojo.com/u/ChristopheDV)\
**Post date:** [June 13, 2015, 5:41am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/19 "2015-06-13T05:41:17Z")

</div>

[quote=193778:@Rob Egal]@Christoph De&nbsp;Vocht Looks good but for OSX you should use the native Imagebrowser (MBS plugins has this). Works much faster, smoother and flexible.  
I don’t consider it as a valuable feedback. Sometimes the community makes we wonder…[/quote]

No offence intended. Long toes? 😉  
I was just pointing out there is already a native OS X control for this. So if a dev is only coding for OS X there is no need for this.  
But yours is certainly useable when you need cross platform compatibility.

Did you consider a scalable ImageBrowser? Could not find this in the current version.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [June 13, 2015, 8:42am UTC](https://forum.xojo.com/t/imagebrowser-1-11-class/24858/20 "2015-06-13T08:42:20Z")

</div>

Trying to ember the image:  
 ![](http://fs1.directupload.net/images/150611/gxlw3425.jpg)

OK folks: to embed an image, copy the Hotlink URL in the image button pasted code.

[Next page](https://forum.xojo.com/t/imagebrowser-1-11-class/24858.md?page=2)
