Liang Weike wrote: > Hello Carsten, > > At present I'm trying to implement the function of the button "delete". > I think I should take the steps as follows: > Firstly, retrieve the image that the user selects; > Secondly, judge if the image is involved in the image-imported manager. > If so, show a message box to let the user make sure and then remove the > image from the manager. If not, inform the user that he/she can not > delete the original image. > Thirdly, remove the image from the toolbox. Hi Liang Weike,
That sounds good to me. We could use a way to support users to not be able to delete built-in images. Just disable the "Delete" button whenever the user selects a built-in image. > > And now the problem I met is how I can judge if the image is within the > image-imported manager. > I can get the selected graphic by using the method GetSelectedIcon(). > But I have no idea how to get its URL because I want to use the method > "hasImage" of XImageManager. > > Is there any problems about my approach? And could you give me some > hints about my question? Thanks! I see your problem. You have to store the URLs in a collection class member (I think a hash map suits best) which uses the ID of the images as the key. You get the ID of an image/button that the user has selected. This ID can be used to query for the URL in the collection (just use the ID as a key to access the hash map). Please look at the ctor where a hash map (ImageInfo) is used to determine from which ImageManager an image has been retrieved. You can use it as an example for your work. Regards, Carsten --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]