ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TImageEnMView Checkbox Visibility
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Jun 20 2014 :  06:02:59  Show Profile  Reply
Is it possible... or if not, can an option be added to TImageEnMView which would make checkboxes visible if a thumbnail is selected and not visible on unselected thumbnails?

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development

xequte

39056 Posts

Posted - Jun 21 2014 :  21:32:54  Show Profile  Reply
Hi Bill

Can you please tell us more about your rationale behind this feature?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jun 22 2014 :  04:43:18  Show Profile  Reply
We are using the checkbox to remove a thumbnail, so moving the mouse over the thumbnail exposes the checkbox. User then selects the checkbox to remove the thumbnail. All other thumbnails do not show the checkbox unless the thumbnail is selected or the mouse is over the thumbnail. This is from the specs from my client who wants this feature.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

39056 Posts

Posted - Jun 22 2014 :  20:23:12  Show Profile  Reply
Hi Bill

Please download the latest source and use:

ImageEnMView1.Checkboxes := iecbShowOnHover;

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jun 23 2014 :  07:41:33  Show Profile  Reply
Thank-you for adding the new feature. The new checkbox visibility feature works well... but how do you uncheck a checkbox?
I tried:
procedure TForm1.Collection1CheckboxClick(Sender: TObject; idx: Integer;
  var bChecked: Boolean);
{ Collection1CheckboxClick. }
begin
  { Delete the checked image? }
  AdvTaskDialog1.Clear;
  AdvTaskDialog1.Title := 'Warning';
  AdvTaskDialog1.Instruction := 'Delete This Image';
  AdvTaskDialog1.Content := 'Delete this image from the collection?';
  AdvTaskDialog1.DialogPosition := dpOwnerFormCenter;
  AdvTaskDialog1.Icon := tiQuestion;
  AdvTaskDialog1.CommonButtons := [cbYes, cbNo];
  if AdvTaskDialog1.Execute = mrYes then
  begin
    if bChecked then
    begin
      { Remove the item from the collection }
      Collection1.DeleteImage(idx);
      Collection1.Update;
    end;
  end
  else 
  begin
    { uncheck the checkbox if the image is not deleted }
    Collection1.Checked[idx] := False;
    Collection1.UpdateImage(idx);
    Collection1.Update;
  end;
end;

but the checkbox remains checked if the user selects no?

When the user does not delete the thumbnail the checkbox remains checked despite unchecking the checkbox and refreshing the thumbnail,

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

39056 Posts

Posted - Jun 23 2014 :  14:47:39  Show Profile  Reply
Hi Bill

The CheckboxClick event has a bChecked var parameter. You just need to change that to false.


  if AdvTaskDialog1.Execute = mrYes then
  begin
    if bChecked then
    begin
      { Remove the item from the collection }
      Collection1.DeleteImage(idx);
      Collection1.Update;
    end;
  end
  else 
  begin
    { uncheck the checkbox if the image is not deleted }
    bChecked := False;
  end;


Actually I did not envisage deletion of the checked item during this event, but examining the code, calling it in this manner should not present any issues.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jun 23 2014 :  15:47:51  Show Profile  Reply
Nigel,

bChecked := False works as expected. Thanks for your efforts. My client will be very happy!


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: