- Name ImagePanel
- CSS Class Div : "CC_ImagePanel", Child Images: "CC_Image", Curretly Selected Image: "CC_Image Selected"
- Type Controls.Image
The ImagePanel allows you to group a collection of Images, either declared
inline in the ASPX as Chan Images or added via one of the Add() method
overloads. It's base uses include showing a selection of images to the
user and automatic image-gallery creation.
Development versions of the ImagePanel have Javascript scrolling, and
can even be styled as a DropDown selecter or a slideshow, as well as
dedicated javascript objects to manipulate and hook to. For now the
Panel merely shows its child images in an (optionally) overflowed DIV
whilst exposing the Target property and CSS styling the selected image.
Like the Chan DropDown the ImagePanel does not hold its state across
PostBacks, meaning you will usually have to populate it during Page_Init(),
despite this it contains a suite of addition, removal and move functions.
Roadmap
- Impliment scrolling
- Proper server and client side object model, nice JS API would be good too.
| Qualifiers |
Type |
Name |
Default |
Description |
|
string |
id |
"" |
Unique identifier within the page for the control |
|
bool |
Visible |
true |
Wether or not the control is rendered into the page's HTML. |
|
bool |
NoScript |
false |
Wether or not the control generates javascript, the Target functionality aside from "Switch" is preserved via postbacks, so long as the ImagePanel is within a Form. |
|
string |
Target |
"" |
Either the ID of another Image control in which to show the Zoom image when an image in the collection is clicked on, the Target image will also have its Tag set to that of the selected image (NoScript Requires the ImagePanel control to be within a Form), or "switch" which will swap Zoom with Path during mouse rollover. |
|
bool |
Cache |
true |
If true then Javascript will be created that pre-caches each child image's Zoom image, speeding up galleries on the client |
|
string |
OnClick |
"" |
(Advanced) Name of a custom javascript function to invoke when the user clicks on an image, it will be passed a CC_ImagePanel javascript object containing details about the imagepanel and an array of C__ImageOption objects, view Controls_ImaegPanel.js for clues! |
|
int |
Count |
0 |
The number of images in the collection |
|
int |
SelectedIndex |
-1 |
The index in the collection of the currently selected image, -1 equates to "non selected" |
|
Controls.Image |
SelectedImage |
null |
The currently selected image, null equates to "non selected" |
| Qualifiers |
Type |
Name |
Params |
Description |
|
|
Add |
( string Path ) |
Add an image having the specified Path |
|
|
Add |
( string Path , string Zoom ) |
Add an image having the specified Path and alternative "Zoom" image path |
|
|
Add |
( string Path , string Zoom , string Tag ) |
Add an image having the specified Path, Zoom and Tag |
|
|
AddImage |
( Controls.Image Img ) |
Add a native Chan Image object |
|
|
Remove |
( Controls.Image Img ) |
Remove an image from the collection, if it exists |
|
|
RemoveAll |
( ) |
Remove all images from the collection |
|
Controls.Image |
ByIndex |
( int Index ) |
Returns the Chan Image at the given index in the collection, or null if Index is out of bounds |
|
Controls.Image |
ByPath |
( string Path ) |
Returns the Chan Image having the given Path, or null if not found |
|
Controls.Image |
ByZoom |
( string Zoom ) |
Returns the Chan Image having the given Zoom, or null if not found |
|
Controls.Image |
ByTag |
( string Tag ) |
Returns the Chan Image having the given Tag, or null if not found |
|
|
MoveSwap |
( int Index1 , int Index2 ) |
Swap the two image's positions in the collection, if either index is out of bounds nothing will happen |
|
|
MoveSwap |
( Controls.Image Img1 , Controls.Image Img2 ) |
Swap the two image's positions in the collection, if either image is not present in the collection nothing will happen |
|
|
MoveFirst |
( Controls.Image Img ) |
Move the Image to the start of the list (index zero), if present |
|
|
MoveDown |
( Controls.Image Img ) |
Move the Image one step towards the start of the list, if present |
|
|
MoveUp |
( Controls.Image Img ) |
Move the Image one step towards the end of the list, if present |
|
|
MoveLast |
( Controls.Image Img ) |
Move the Image to the end of the list (highest index), if present |