While using Fabric lib, how to set a cursor during isDrawingMode to a custom cursor file - cursor

I use Fabric lib and I want to change the cursor to an external cursor file.
I usually do it using the canvas CSS by changing the cursor to the url of the cursor file.
any way to do it in fabric?
I tried: canvas.freeDrawingCursor = 'url(http://www.example.com/MyBrush.cur)'; but it doesn't work.
any idea?

You have to use following syntax to add cursor file as a resource :
canvas.freeDrawingCursor='url(http://ani.cursors-4u.net/movie/mov-2/mov130.cur),default';
Basically freedrawingcursor is having two arguments when you are dealing with external resource :
1. URL of resource or file
2. type of cursor in that file

Related

Can Not Refactor Class Name in XCode

I am trying to rename the class name for a view controller (which has an associated .xib file) via XCode's refactoring tool. After entering a new name, I get this error message (no preview of changes):
The selection is not a type that can be renamed.
Make a different selection and try again.
I have tried all the suggestions in this SO thread, but no luck.
What could prevent XCode from being able to refactor a class (and related file names), when other classes and variables can be refactored without any problem?
I think you tried to change the classname by selecting the file and press refactor or you select it in the #import "classname".
Instead try to select "classname" in the interface definition after #interface
I also met this problem
Here is my solution
Move the whole Project to another place Then it works(to me)

HelperProvider always open the index file

I want to build a context sensitive help for a winforms application, to do this I use a class with a reference to the HelperProvider component, HelpNamespace is set to the index html file and when a form is loaded I register each control in the form to the helperprovider with a topic that I get from a config file :
helpProvider.SetShowHelp(control, true);
helpProvider.SetHelpNavigator(control, helpNavigator);
helpProvider.SetHelpKeyword(control, helpKeyword);
when debugging I am sure that some controls are configured with some topics different from index file but when running and pressing F1 its always the index file (HelpNamespace) that is opened. When using a HelperProvider instance for each control and no single instance for all controls, that works fine!
Why I can't use a single instance of helperProvider for all controls?
You need SetHelpKeyword for each control. A HelpNavigator.TopicId may be useful for a CHM with topic ID's inside.
I'm missing ".Topic" in your code sample above. Try the code below or download a working example from:
http://www.help-info.de/files_download/CSharp2008_CHM.zip
// set F1 help topic for controls on this form
helpProvider1.SetHelpNavigator(this.btnStart, HelpNavigator.Topic);
helpProvider1.SetHelpKeyword(this.btnStart, #"/Garden/flowers.htm");
helpProvider1.SetHelpNavigator(this.btnExit, HelpNavigator.Topic);
helpProvider1.SetHelpKeyword(this.btnExit, #"/Garden/tree.htm");
helpProvider1.SetHelpNavigator(this.chkShowHelpWithNavigationPane, HelpNavigator.Topic);
helpProvider1.SetHelpKeyword(this.chkShowHelpWithNavigationPane, #"/HTMLHelp_Examples/jump_to_anchor.htm#AnchorSample");

ReportViewer WPF - Set Images Dynamically

I'd like to load image(s) at runtime (dynamically) into my report (inside the header).
I've already create the following parameter:
Name: Path
Datatype: String (should be the path to the image)
Allow Blank = True
Then I've draged and droped an image control to my report.
Set the name to: Image2
Imagesource: External
Use the following image: [#Path]
Now (back in my MainWindow) I've added the following code:
viewerInstance.LocalReport.EnableExternalImages = true;
List<ReportParameter> param1 = new List<ReportParameter>();
//header_2.png exists (for test purposes) in the root folder
param1.Add(new ReportParameter("Path", #"/header_2.png"));
viewerInstance.LocalReport.SetParameters(param1);
It doesn't work.
I'll get this error message:
The invocation of the constructor on type 'ReportViewer.MainWindow' that matches the specified binding constraints threw an exception.
{"The source of the report definition has not been specified"}
Any ideas?
I am not very sure about how to do it with External Images using the absolute path in SSRS 2008. But I guess I can provide with a workaround but this would work only in case you have all the images that you would be using in reports available to you beforehand.
You can add an Image control to the report. In the Image Control property, provide name, select the image source as Embedded, and click on Import, and select the image. Click Import. The image is imported. Now you can import all images like this. Once done, go to Image control property again and set the Use this Image as "[#Path]". Now you do not need to pass the absolute path but only the image name amongst the imported images which you can see under images in Report Data.
Also, if you want to use External Images, as per this msdn article you need to provide the Url for the image and not the absolute path. In this case you can hoist your image on a server and pass the path in the Path parameter. Select the image source as External. I have tested this and it works.
Edit: You can also upload the images to the ReportServer through the Report Manager and provide the path to that image as the relative path in the RDL after you specify the Image Source as external. e.g. /Report/Logo.png. You can also upload multiple images and use them by providing the path as parameter to the report.

Drupal Attachments (FileField) file path

What function in Drupal gets file attachment path?
Edit: the attachments provided by Upload module in system section. But since you mentioned there may be another way around it. Maybe I could achieve may goals using FileField module so if you could tell me how to get a direct link of a file uploaded by FileField module that may also be very helpful.
Edit 2:
Ok I will start from my main and final objective:
It is to get an image linking to a file which visibility I could be managed using CCK module.
I am doing this step by step. So now I have written a code which generates the needed image and I have added that image to one of content types teaser. I found a way to warp my image in a tag and I had dug up simple attachments url. So my next step is to advance from simple upload attachment to the one added by FileFields and from odd looking HTML pace in all PHP document into beautifully managed CCK field.
How to fetch file path of a file uploaded FileFields?
Some plain and at the same time rich tutorials for making custom fields for CCK module.
Assuming you know how to get the $node object for a node containing a file attachment, this is super easy:
Upload (core)
$file = upload_load($node);
echo $file[1]->filepath;
Where 1 is the index of the file. Upload can let you upload more than one file, so file 2 would have an index of 2 and so on. If there's only one file, it'll always be 1.
More info: upload_load() API reference.
FileField
echo $node->field_fieldname[0]['filepath'];
Where field_filename is the short name you've used for the field, and 0 is the index of the field. CCK fields let you have multiple values in one field, so 0 would be the first, 1 would be the second, etc. If you only have one value, it'll always be 0.
Note: if you want to get the rendered output of the FileField using its formatters, you can just use $field_fieldname in your node template, or if you want to store the rendered output, you can use:
echo content_format('field_fieldname', $node->field_fieldname[0]);
More info: content_format() API reference.
Upload is a sad little module, and has been completely replaced with a core implementation of FileField in Drupal 7. If you have the option to use FileField, you should.
Don't direct links of file attachments appear below the uploaded file for the core Upload module?
Since you are trying to use images, you should use http://drupal.org/project/imagefield CCK module in order to add images to specified content type. After that using the Display fields tab in Content type configuration you can specify how image would be presented (as a link, image, image with link to node...) both in teaser and body view.

How to start the associated program when selecting more than one files?

I have set .jpg file associated to my own program. I want to add the context menu to .jpg files, so I set the entry of HKCR.jpg\shell\open\command to "myProg.exe %1". After associating, there will be an item on the top of the context menu saying "Open image with myprog". This works right when I select a single .jpg file, but when I selected more than one file and click the top item of the context menu, nothing happended. How can I solve the problem?
Thank you very much
Each selected file will be sent to a new instance of your application. Your application should check if a previous version exists, or not. If a previous instance exists, it should sent its parameters to it (e.g. using Windows Messages) and then terminate.
Another approach is to use DDE (Dynamic Data Exchange), an old method used by Shell to send all files to one instance of your program.
You might need double quotes around the "%1".
Read this article for much more detailed information about how all this works.
http://msdn.microsoft.com/en-us/library/bb776883.aspx
Also, this blog entry talks about what you need to do specifically for multi-select command execution: http://blogs.msdn.com/pix/archive/2006/06/30/652889.aspx

Resources