ImageEn, unit iemview

TImageEnMView.SetStyleEx

TImageEnMView.SetStyleEx


Declaration

procedure SetStyleEx(aStyle: TIEMStyle;
                     TopText : TIEImageEnMViewDefaultText;
                     InfoText : TIEImageEnMViewDefaultText;
                     BottomText : TIEImageEnMViewDefaultText;
                     iThumbZoom: Double = 0;
                     bAdjustSpacing: Boolean = True;
                     bAdjustStyle: Boolean = True;
                     bAdjustFont: Boolean = True;
                     bAdjustGrid: Boolean = False);


Description

Provides a shortcut method to set the style of the control to several predefined styles:

ImageEnMView1.SetStyleEx( iemsFlat, iedtNone, iedtNone, iedtFileName );


ImageEnMView1.SetStyleEx( iemsFlatAndWide, iedtFileName, iedtFilePath, iedtImageDimAndSize );


ImageEnMView1.SetStyleEx( iemsColumns, iedtFileName, iedtImageDimAndSize, iedtFileCreateDate );


ImageEnMView1.GridWidth := 1;
ImageEnMView1.SetStyleEx( iemsFilenames, iedtNone, iedtNone, iedtFileName );



Parameter Description
aStyle Sets Style to one of iemsFlat, iemsFlatAndWide, iemsColumns or iemsFilenames
TopText Sets DefaultTopText
InfoText Sets DefaultInfoText
BottomText Sets DefaultBottomText
iThumbZoom Sets Zoom. If a negative value is specified then Zoom will be set to give a thumbnail of that height in pixels (i.e. -22 would set the thumbnail height to 22 pixels). If 0 is specified, then actual zoom will depend on the specified aStyle
bAdjustSpacing Sets the following properties with values best for the specified aStyle (and considering SoftShadow):
 LeftGap
 RightGap
 UpperGap
 BottomGap
 TextMargin
 TextBlockWidth
 VertBorder
 HorizBorder
bAdjustStyle Sets the ThumbnailsBorderWidth to 0 if aStyle is iemsColumns. Also adds ietxOnlyShowIcons to ThumbnailOptionsEx for iemsFilenames or iemsColumns styles
bAdjustFont Sets the TopTextFont to [fsBold] if aStyle is iemsFlatAndWide
bAdjustGrid Sets the GridWidth to 1 if aStyle is iemsFlatAndWide, otherwise -1

Note:
 If you have already set text for your images then you won't see the default text values you've specified above
 An easier method is to use AutoAdjustStyle


Example

// An application with menu items to change the view style
procedure TForm1.FormCreate(Sender: TObject);
begin
  ImageEnMView1.SetModernStyling( True );
end;

// Show Thumbs
procedure TForm1.rdbShowThumbsClick(Sender: TObject);
begin
  ImageEnMView1.SetStyleEx( iemsFlat, iedtNone, iedtNone, iedtFileName, 0, True, True, True, True );
end;


// Show Large Thumbs
procedure TForm1.rdbShowLargeThumbsClick(Sender: TObject);
begin
  ImageEnMView1.SetStyleEx( iemsFlat, iedtNone, iedtNone, iedtFileName, 200 );
end;

// Show Small Thumbs with Detail
procedure TForm1.rdbShowDetailsClick(Sender: TObject);
begin
  ImageEnMView1.SetStyleEx( iemsFlatAndWide, iedtFileName, iedtFilePath, iedtImageDimAndSize, 0, True, True, True, True );
end;


// Show Text Columns
procedure TForm1.rdbShowColumnsClick(Sender: TObject);
begin
  ImageEnMView1.SetStyleEx( iemsColumns, iedtFileName, iedtImageDimAndSize, iedtFileCreateDate, 0, True, True, True, True );
end;


// Show File List
procedure TForm1.rdbShowFileListClick(Sender: TObject);
begin
  ImageEnMView1.SetStyleEx( iemsFilenames, iedtNone, iedtNone, iedtFileName, 0, True, True, True, True );
end;



Demo

Demo  Demos\Multi\MViewStyles\MViewStyles.dpr


See Also

 Style
 AutoAdjustStyle
 SetModernStyling
 ThumbnailOptionsEx