Search Results

Search found 2876 results on 116 pages for 'cursor'.

Page 31/116 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • How to Navigate Directly From One Table to Another in Word 2013

    - by Lori Kaufman
    Jumping to a specific page in Word is a common task and easy to do using the Find and Replace dialog box. You can also use this same tab to jump from one table directly to the next table in your document. Your cursor does not have to be in a table to jump to the next table. Put the cursor in any paragraph or table and press F5 or use the Ctrl + G keystroke combination to open the Find and Replace dialog box. The Go To tab is automatically selected. Select Table from the Go to what list and click Next. The next table in your document is selected and the Find and Replace dialog box stays open.    

    Read the article

  • Lubuntu 12.04 installation trouble

    - by Evaggelos Tsampazis
    I have i problem! I can't install the Lubuntu 12.04 on my old pc. I only get to the point where I have entered all the needed information (hard drive, username, password etc). When the installation wizard is starting to copy files from the cd to the hard drive, I get after about one minute a blank sreen with only themouse cursor! I can move the mouse cursor but the whole procegure is stoped! Nothing happens after that! My PC: Compaq Pressario 7000 Pentium III 933 MHz 768 MB RAM Any idea how to solve it?? Thanks!!!

    Read the article

  • How to change Shift + <Keypad Key> behavior ?

    - by LeGEC
    I am used to use the numeric keypad for navigation (e.g. : [KP7] - Start, [KP1] - End, [KP4] - Left, etc... ). I am also used to use it for selection (e.g. : Shift+[KP7] - Select from cursor position to beginning of line, Shift+[KP1] - Select from cursor position to end of line, etc...) With the keyboard configuration installed with Ubuntu, though, Shift+[KP7] prints the character "7", Shift+[KP1] prints "1", etc... How can I change this so that Shift+[KP-key] is not mapped to [key], but to Shift+[KP-key] ?

    Read the article

  • Keyboard shortcuts don't work continuously

    - by T. K.
    First I had the problem of the keyboard layout resetting itself on each reboot from DE (german) to EN (us). I followed the advice of using dconf in order to make the DE layout my personal default (see Keyboard layout switches to English each time I reboot). However, after that, my shortcuts didn't work properly anymore. In Firefox, Kile etc. everything works fine while in Nautilus, copying/erasing/pasting is impossible even when I change the keyboard layout back to En (us). Also, I'm not even able to select multiple items using the cursor in Nautilus while every acts normal on the desktop. It's quite confusing. I've read about a similar bug (see https://bugs.launchpad.net/unity/+bug/1226962) but since German is a latin language there is no appropriate solution given for my problem. Any help is really appreciated here. Edit: The third reboot resolved the problem so the shortcuts finally work in Nautilus again. Still, selecting multiple objects using the cursor isn't possible.

    Read the article

  • Multitouch screen needs two touch points

    - by BloodPhilia
    So, I got a netbook (Some weird China brand) and it has a multitouch screen. I got to installing Ubuntu Netbook 10.10 and I used the mouse and keyboard for that. When I wanted to try the touchscreen, at first it didn't seem to work, then I tried to multitouch, and this is what happens: I put my finger on point A I put my finger on point B, while still holding point A. The cursor now jumps to the location on the screen where point A is touched. I can now use point A to drag the cursor ONLY when holding point B. I can use point B for clicking by tapping, but ONLY when holding point A at the place I want to click. What is going on?

    Read the article

  • Laptop works fine with ac adapter, hangs after login screen using battery

    - by tavoton
    I did an Ubuntu 10.10 Desktop Edition clean install (amd64 version) on a notebook Medion Akoya E1311. With AC adapter everything works fine, but using battery, it hangs after login screen. I can type login, password too, and I can press login button. But then I can see mouse cursor and lower task bar, not upper, and nothing works. The only thing I can do is login on a terminal with ctrl+alt+F1, this is ok. Nothing seems alive on Gnome except mouse cursor. The only thing I did after Ubuntu fresh install was donwloading driver for RTL8191SE from Realtek web, because WiFi didn't work, now works fine, with ac adapter of course. Hardware is a Notebook Medion Akoya E1311 AMD Sempron 210U 1 GB DDR2 ATI RS690M (Radeon X1200 Series) Western Digital 160GB wireless RTL8191SEvB ethernet RTL8101E/RTL8102E

    Read the article

  • Editing XML Literals Embedded Expressions in Visual Basic 2010 (Avner Aharoni)

    The implicit line continuation feature in Visual Basic 2010 provided an opportunity to improve the code editing experience in XML literals embedded expressions. In Visual Studio 2008, pressing Enter inside an embedded expression would result in the cursor being positioned to the left of the end embedded expression tag. In Visual Studio 2010, pressing Enter inserts a newline for the cursor, and the end embedded expression tag moves to the line below. This minimizes the number of key strokes needed...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Incorrect key mappings in remote NX session

    - by Roger Light
    I'm using the NoMachine provided NX client on Ubuntu 10.10 running on a laptop. I'm connecting to a FreeNX server that happens to be running on openSUSE. I'm having trouble with keys being incorrect in the remote session. The most noticable example is that when I press up cursor, the screen shot dialog appears instead. As far as I can gather easily, the cursor keys and delete are affected. It's worth noting that it doesn't display the same behaviour if I dual boot to Windows XP, or from a different machine using openSUSE. I'm not really sure where to begin looking. Any suggestions?

    Read the article

  • Button click event in the Ogre3d for ios

    - by user1184398
    Is it possible to access the button click event by using the cursor? These are the steps I followed for the button click event using the SDK trays m_pTrayMgr = new OgreBites::SdkTrayManager("TrayMgr", m_pRenderWnd, m_pMouse, this); I create the buttons m_LeftBtn = tray->createButton(OgreBites:: TL_LEFT, "sdk_button_down", "Left"); m_RightBtn = tray->createButton(OgreBites::TL_RIGHT, "sdk_button_up", "Right"); And I am calling this function void OgreFramework::buttonHit(OgreBites::Button* button) { if(button->getName().compare("sdk_button_down") == 0 ) { printf("XXX"); } } But the button hit function is not getting called... Could somebody provide some sample code? I'm not using any cursor for the click.

    Read the article

  • Triangle Picking Picking Back faces

    - by Tangeleno
    I'm having a bit of trouble with 3D picking, at first I thought my ray was inaccurate but it turns out that the picking is happening on faces facing the camera and faces facing away from the camera which I'm currently culling. Here's my ray creation code, I'm pretty sure the problem isn't here but I've been wrong before. private uint Pick() { Ray cursorRay = CalculateCursorRay(); Vector3? point = Control.Mesh.RayCast(cursorRay); if (point != null) { Tile hitTile = Control.TileMesh.GetTileAtPoint(point); return hitTile == null ? uint.MaxValue : (uint)(hitTile.X + hitTile.Y * Control.Generator.TilesWide); } return uint.MaxValue; } private Ray CalculateCursorRay() { Vector3 nearPoint = Control.Camera.Unproject(new Vector3(Cursor.Position.X, Control.ClientRectangle.Height - Cursor.Position.Y, 0f)); Vector3 farPoint = Control.Camera.Unproject(new Vector3(Cursor.Position.X, Control.ClientRectangle.Height - Cursor.Position.Y, 1f)); Vector3 direction = farPoint - nearPoint; direction.Normalize(); return new Ray(nearPoint, direction); } public Vector3 Camera.Unproject(Vector3 source) { Vector4 result; result.X = (source.X - _control.ClientRectangle.X) * 2 / _control.ClientRectangle.Width - 1; result.Y = (source.Y - _control.ClientRectangle.Y) * 2 / _control.ClientRectangle.Height - 1; result.Z = source.Z - 1; if (_farPlane - 1 == 0) result.Z = 0; else result.Z = result.Z / (_farPlane - 1); result.W = 1f; result = Vector4.Transform(result, Matrix4.Invert(ProjectionMatrix)); result = Vector4.Transform(result, Matrix4.Invert(ViewMatrix)); result = Vector4.Transform(result, Matrix4.Invert(_world)); result = Vector4.Divide(result, result.W); return new Vector3(result.X, result.Y, result.Z); } And my triangle intersection code. Ripped mainly from the XNA picking sample. public float? Intersects(Ray ray) { float? closestHit = Bounds.Intersects(ray); if (closestHit != null && Vertices.Length == 3) { Vector3 e1, e2; Vector3.Subtract(ref Vertices[1].Position, ref Vertices[0].Position, out e1); Vector3.Subtract(ref Vertices[2].Position, ref Vertices[0].Position, out e2); Vector3 directionCrossEdge2; Vector3.Cross(ref ray.Direction, ref e2, out directionCrossEdge2); float determinant; Vector3.Dot(ref e1, ref directionCrossEdge2, out determinant); if (determinant > -float.Epsilon && determinant < float.Epsilon) return null; float inverseDeterminant = 1.0f/determinant; Vector3 distanceVector; Vector3.Subtract(ref ray.Position, ref Vertices[0].Position, out distanceVector); float triangleU; Vector3.Dot(ref distanceVector, ref directionCrossEdge2, out triangleU); triangleU *= inverseDeterminant; if (triangleU < 0 || triangleU > 1) return null; Vector3 distanceCrossEdge1; Vector3.Cross(ref distanceVector, ref e1, out distanceCrossEdge1); float triangleV; Vector3.Dot(ref ray.Direction, ref distanceCrossEdge1, out triangleV); triangleV *= inverseDeterminant; if (triangleV < 0 || triangleU + triangleV > 1) return null; float rayDistance; Vector3.Dot(ref e2, ref distanceCrossEdge1, out rayDistance); rayDistance *= inverseDeterminant; if (rayDistance < 0) return null; return rayDistance; } return closestHit; } I'll admit I don't fully understand all of the math behind the intersection and that is something I'm working on, but my understanding was that if rayDistance was less than 0 the face was facing away from the camera, and shouldn't be counted as a hit. So my question is, is there an issue with my intersection or ray creation code, or is there another check I need to perform to tell if the face is facing away from the camera, and if so any hints on what that check might contain would be appreciated.

    Read the article

  • My ubuntu with unity not loading after last reboot

    - by Abonec
    I have asus u36sd and after last reboot I can't start up my ubuntu 11.10. Usually I suspend my notebook by closing cover but today I reboot it and it not starting up. Booting flowing by normal till to login screen but if I move mouse cursor after that image immediately switch to console (without any error; only normal loading startup processes) and back to login screen. I can type my password and boot continuing loading but after few moment it again switch back to dark console and switch again to login screen. I can load recovery mode but if I try touch my cursor (by mouse or internal notebook touchpad) it again switch back to console and to login screen. But if I use only keyboard it work fine. Where I can see detailed log information about my problem?

    Read the article

  • Synaptics touchpad sensitivity. Issue?

    - by Dave
    Just installed 12.04 LTS and I experience some problems with my touchpad. Everytime I tap/double tap the touch the cursor is moving around (not static as should be) (for example if I want to close a window, I click on "x" button from touchpad, the cursor is moving and not always hit the "x" button). Touchpad buttons left click, right click are working well, but tap not. Did u guys experience the same problem? Is there something related to sensitivity? How to fix it? PS: on Ubuntu 11.10 didn't had this issue

    Read the article

  • What are the crappy code games - the background?

    - by simonsabin
    This is part of a series on the Crappy Code Games The background Who can enter? What are the challenges? What are the prizes? Why should I attend? Tips on how to win   The Background Fusion IO came to us a while back wanting to run a competition to highlight the how bad code can really impact your system. We’ve all seen it, I saw an example yesterday where someone had implemented a cursor on a whole table just to update a few rows, something like this. declare cUpdateCursor cursor for  ...(read more)

    Read the article

  • how to change dolphin's select region of a file/folder (in detail view mode)

    - by Daniel
    Since nautilus has removed the dual pane. So I turn to dolphin. I am wondering how to change the default select behavior in detail view mode? Now to select a file/folder, my cursor has to hover over that file/folder and then the left click will take effect, but I much prefer the nautilus way, that is as long as your cursor is in the same row of that file/folder, left click picks up that item. This I think is more robust for user selection, it is faster. Any ideas how to achieve this in dolphin?

    Read the article

  • Tooltip Support For ASP.NET Image Controls v2010 vol 1

    Tooltip property has been added to DevExpress ASP.NET image controls! Starting with DXperience v2010.1, all DevExpress ASP.NET image controls like the ASPxImage have a new property called: Tooltip. Whats a tooltip? Wikipedia defines it as: The tooltip is a common graphical user interface element. It is used in conjunction with a cursor, usually a mouse pointer. The user hovers the cursor over an item, without clicking it, and a tooltip may appear a small "hover box" with information...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • My laptop doesn't always boot to login

    - by GUI Junkie
    I have an recurring problem. Every once in a while, no pattern, the laptop freezes during boot. Sometimes at a black screen, sometimes a black screen with a not blinking cursor... The solution is to power down the laptop, cross my fingers and boot again. Sometimes it takes four or five reboots, but in the end I always get the system up and running. What bugs me is the fact that the boot is not 'stable' in a sense that apparently it doesn't always do exactly the same thing. I'm still using 10.10. The question is whether there is anything that can be done to make the system stable. (Does 11.04 have the same issue?) Edit: Today the same thing happened. First a black screen with a non blinking cursor. Second a black screen. Third login screen.

    Read the article

  • Disable "Ubuntu 14.04" and "Files" from auto sorting alphabetically and THEN<(Disable the then.) automatically going to that location

    - by Doodski Man
    I looked about in Ubuntu 14.04 and I could not find a option to disable a feature that made extra work for me. After renaming something "Files" then reorganizes alphanumerically and then automatically moves the prompt/cursor/highlighting to the new file name at the new alphanumerical location. It's much easier and practical if the working cursor remains in the same area where the file was found that needed name changes or needed name spelling corrections. Windows 7 does what I ask about and it's a huge improvement over that auto sort and then go to the new file location. A example to consider is a file is in the "A" area and then you rename it to a "Z" and you are then taken to the "Z" stuff and need to scroll hundreds of lines back to the "A" section. It's annoying. Thanks for reading and taking the time.

    Read the article

  • Translating multiple objects in GUI based on average position?

    - by user1423893
    I use this method to move a single object in 3D space, it accounts for a local offset based on where the cursor ray hits the widget and the center of the widget. var cursorRay = cursor.Ray; Vector3 goalPosition = translationWidget.GoalPosition; Vector3 position = cursorRay.Origin + cursorRay.Direction * grabDistance; // Constrain object movement based on selected axis switch (translationWidget.AxisSelected) { case AxisSelected.All: goalPosition = position; break; case AxisSelected.None: break; case AxisSelected.X: goalPosition.X = position.X; break; case AxisSelected.Y: goalPosition.Y = position.Y; break; case AxisSelected.Z: goalPosition.Z = position.Z; break; } translationWidget.GoalPosition = goalPosition; Vector3 p = goalPosition - translationWidget.LocalOffset; objectSelected.Position = p; I would like to move multiple objects based on the same principle and using a widget which is located at the average position of all the objects currently selected. I thought that I would have to translate each object based on their offset from the average point and then include the local offset. var cursorRay = cursor.Ray; Vector3 goalPosition = translationWidget.GoalPosition; Vector3 position = cursorRay.Origin + cursorRay.Direction * grabDistance; // Constrain object movement based on selected axis switch (translationWidget.AxisSelected) { case AxisSelected.All: goalPosition = position; break; case AxisSelected.None: break; case AxisSelected.X: goalPosition.X = position.X; break; case AxisSelected.Y: goalPosition.Y = position.Y; break; case AxisSelected.Z: goalPosition.Z = position.Z; break; } translationWidget.GoalPosition = goalPosition; Vector3 p = goalPosition - translationWidget.LocalOffset; int numSelectedObjects = objectSelectedList.Count; for (int i = 0; i < numSelectedObjects; ++i) { objectSelectedList[i].Position = (objectSelectedList[i].Position - translationWidget.Position) + p; } This doesn't work as the object starts shaking, which I think is because I haven't accounted for the new offset correctly. Where have I gone wrong?

    Read the article

  • Lost in Code?

    - by Geertjan
    Sometimes you're coding and you find yourself forgetting your context. For example, look at this situation: The cursor is on line 52. Imagine you're coding there and you're puzzling on some problem for some time. Wouldn't it be handy to know, without scrolling up (and then back down again to where you were working), what the method signature looks like? And does the method begin two lines above the visible code or 10 lines? That information can now, in NetBeans iDE 7.3 (and already in the 7.3 Beta) very easily be ascertained, by putting the cursor on the closing brace of the code block: As you can see, a new vertical line is shown parallel to the line numbers, connecting the end of the method with its start, as well as, at the top of the editor, the complete method signature, together with the number of the line on which it's found. Very handy. Same support is found for other file types, such as in JavaScript files.

    Read the article

  • Get information about AutocompleteTextView from resulting AutoCompleteTextView$DropDownListView

    - by Stev_k
    I'm using 3 AutocompleteTextViews to suggest entries from a database. I subclassed AutocompleteTextView to handle setting the default text to null when clicked and setting back to the default instructions if moved away and nothing is entered. I was using a SimpleCursorAdapter to bind to the view, but I discovered that there was no way I could get the id of the AutocompleteTextView from an OnItemClickListener, which I needed to put additional information from the selected row in a variable depending on which AutocompleteTextView it was from. All I could access was the AutoCompleteTextView$DropDownListView, which is an undocumented inner class that appears to offer no real functionality. Neither was there a way to go up the view hierarchy to get the original AutocompleteTextView. So I subclassed SimpleCursorAdapter and added an int to the constructor to identify which AutocompleteTextView the adapter was from, and I was able to access this from the view passed into OnItemClick(). So, although my solution works fine, I wonder if it is possible to get the id of an AutocompleteTextView from its DropDownListView? I am also using another database query which gets the id from the OnItemClick and then looks up the data for that item, because I couldn't find a way of converting more than one column to a string. Should I be using CursorAdapter for this, to save initiating another query? Oh, and another thing, do I need a database cursor initially (all_cursor) when all I'm doing is filtering on it to get a new cursor? Seems like overkill. Activity .... dbse.openDataBase(); Cursor all_Cursor = dbse.autocomplete_query(); startManagingCursor(all_Cursor); String[] from_all = new String[]{DbAdapter.KEY_NAME}; int[] to_all = new int[] {android.R.id.text1}; from_adapt = new AutocompleteAdapter(FROM_DBADAPTER, this,android.R.layout.simple_dropdown_item_1line, all_Cursor, from_all, to_all); from_adapt.setStringConversionColumn(1); from_adapt.setFilterQueryProvider(this); to_adapt = new AutocompleteAdapter(TO_DBADAPTER, this,android.R.layout.simple_dropdown_item_1line, all_Cursor, from_all, to_all); to_adapt.setStringConversionColumn(1); to_adapt.setFilterQueryProvider(this); from_auto_complete = (Autocomplete) findViewById(R.id.entry_from); from_auto_complete.setAdapter(from_adapt); from_auto_complete.setOnItemClickListener(this); to_auto_complete = (Autocomplete) findViewById(R.id.entry_to); to_auto_complete.setAdapter(to_adapt); to_auto_complete.setOnItemClickListener(this); public void onItemClick (AdapterView<?> parent, View view, int position, long id) { Cursor selected_row_cursor = dbse.data_from_id(id); selected_row_cursor.moveToFirst(); String lat = selected_row_cursor.getString(1); String lon = selected_row_cursor.getString(2); int source = ((AutocompleteAdapter) parent.getAdapter()).getSource(); Autocomplete class: public class Autocomplete extends AutoCompleteTextView implements OnTouchListener,OnFocusChangeListener{ String textcontent; Context mycontext = null; int viewid = this.getId(); public Autocomplete(Context context, AttributeSet attrs) { super(context, attrs); textcontent = this.getText().toString(); mycontext = context; this.setOnFocusChangeListener(this); this.setOnTouchListener(this); } public boolean onTouch(View v, MotionEvent event) { if (textcontent.equals(mycontext.getString(R.string.from_textbox)) | textcontent.equals(mycontext.getString(R.string.to_textbox)) | textcontent.equals(mycontext.getString(R.string.via_textbox))) { this.setText(""); } return false; } public void onFocusChange(View v, boolean hasFocus) { if (hasFocus == false) { int a = this.getText().length(); if (a == 0){ if (viewid == R.id.entry_from) {this.setText(R.string.from_textbox);} if (viewid == R.id.entry_to) {this.setText(R.string.to_textbox);} if (viewid == R.id.entry_via) {this.setText(R.string.via_textbox);} } } } } Adapter: public class AutocompleteAdapter extends SimpleCursorAdapter { int source; public AutocompleteAdapter(int query_source, Context context, int layout, Cursor c, String[] from, int[] to) { super(context, layout, c, from, to); source = query_source; } public int getSource() { return source; } } sorry that's a lot of code! Thanks for your help. Stephen

    Read the article

  • Placing component on Glass Pane

    - by Chris Lieb
    I have a subclass of JLabel that forms a component of my GUI. I have implemented the ability to drag and drop the component from one container to another, but without any visual effects. I want to have this JLabel follow the cursor during the drag of the item from one container to another. I figured that I could just create a glass pane and draw it on there. However, even after I add the component to the glass pane, set the component visible, and set the glass pane visible, and set the glass pane as opaque, I still so not see the component. I know the component works because I can add it to the content pane and have it show up. How do I add a component to the glass pane? package wpics509s10t7.view; import javax.swing.*; import wpics509s10t7.model.Tile; import java.awt.*; import java.awt.dnd.DragSource; import java.awt.event.AWTEventListener; import java.awt.event.MouseEvent; /** * GlassPane tutorial * "A well-behaved GlassPane" * http://weblogs.java.net/blog/alexfromsun/ * <p/> * This is the final version of the GlassPane * it is transparent for MouseEvents, * and respects underneath component's cursors by default, * it is also friedly for other users, * if someone adds a mouseListener to this GlassPane * or set a new cursor it will respect them * * @author Alexander Potochkin */ public class GlassPane extends JPanel implements AWTEventListener { private static final long serialVersionUID = 1L; private final JFrame frame; private TileView tv; // subclass of JLabel private Point point; private WordStealApp wsa; public GlassPane(JFrame frame, WordStealApp wsa) { super(null); this.wsa = wsa; this.frame = frame; setOpaque(true); setLayout(null); setVisible(true); composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f); } public void beginDrag(Tile t, Point p) { this.tv = new TileView(t, null, this.wsa, true); this.add(this.tv); System.out.println("Starting point: x=" + p.getX() + ",y=" + p.getY()); this.tv.setLocation((int)p.getX(), (int)p.getY()); this.tv.setVisible(true); } public void endDrag(Point p) { System.out.println("Ending point: x=" + p.getX() + ",y=" + p.getY()); this.remove(this.tv); this.tv.setVisible(false); this.tv = null; } public void eventDispatched(AWTEvent event) { if (event instanceof MouseEvent) { MouseEvent me = (MouseEvent) event; if (!SwingUtilities.isDescendingFrom(me.getComponent(), frame)) { return; } if (me.getID() == MouseEvent.MOUSE_EXITED && me.getComponent() == frame) { if (tv != null) { tv.setVisible(false); } point = null; } else { MouseEvent converted = SwingUtilities.convertMouseEvent(me.getComponent(), me, frame.getGlassPane()); point = converted.getPoint(); } repaint(); } } /** * If someone adds a mouseListener to the GlassPane or set a new cursor * we expect that he knows what he is doing * and return the super.contains(x, y) * otherwise we return false to respect the cursors * for the underneath components */ @Override public boolean contains(int x, int y) { if (getMouseListeners().length == 0 && getMouseMotionListeners().length == 0 && getMouseWheelListeners().length == 0 && getCursor() == Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)) { return false; } return super.contains(x, y); } }

    Read the article

  • Problem saving as png a SVG generated by Raphael JS in a canvas

    - by ClemDesm
    Hi fellow SOers, I'm trying to convert a SVG generated by Raphael JS (and the user, since you can drag and rotate the images). I followed this Conversion of SVG to Jpeg but still can't get it. It must be easy but I can't put my finger on what I get wrong. I got my svg in a div with #ec as id and the canvas's one is #canvas. function saveDaPicture(){ var img = document.getElementById('canvas').toDataURL("image/png"); $('body').append('<img src="'+img+'"/>'); } $('#save').click(function(){ var svg = $('#ec').html(); alert(svg); canvg('canvas', svg, {renderCallback: saveDaPicture(), ignoreMouse: true, ignoreAnimation: true}); }); The alert gives me : <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="600" height="512"> <desc>Created with Raphael</desc> <defs></defs> <image x="0" y="0" width="300" height="512" preserveAspectRatio="none" href="imageurl.jpg"></image> <rect x="168" y="275" width="52" height="70" r="0" rx="0" ry="0" fill="none" stroke="#000" stroke-dasharray="8,3" transform="rotate(21.91207728 194 310)" style="opacity: 1; display: none; " opacity="1"></rect> <circle cx="50" cy="50" r="50" fill="none" stroke="#000"></circle> <image x="358" y="10" width="39" height="138" preserveAspectRatio="none" href="imageurl2.png" style="cursor: move; "></image> <image x="397" y="10" width="99" height="153" preserveAspectRatio="none" href="imageurl3.png" style="cursor: move; "></image> <image x="184" y="286" width="10" height="10" preserveAspectRatio="none" href="imageurl4.png" style="cursor: pointer; opacity: 1; display: none; " opacity="1"></image> <image x="204" y="286" width="10" height="10" preserveAspectRatio="none" href="imageurl5.png" style="cursor: pointer; opacity: 1; display: none; " opacity="1"></image> <image x="170" y="277" width="48" height="66" preserveAspectRatio="none" href="imageurl6.png" style="cursor: move; opacity: 1; " r="50" opacity="1" transform="rotate(21.91207728 194 310)"></image> </svg> which is the xml of the svg and if I believe canvg documentation, it's good. Anyway, with this code, the variable img, which should have the converted image data, got the data of an empty png with the dimensions of the svg. The only thing I guess is that the svg generated by Raphael JS is not well formated for canvg (like, href of image should be xlink:href if I follow the W3C recommandations ) Anyone got an idea on this problem ? :D

    Read the article

  • How to programmatically create customcontrol and change its values in Silverlight 4

    - by user361317
    Hi! I want to create a custom tabcontrol class which has an icon before the text, and I want to be able to change the icon in the constructor of the new tabcontrol. I use implicit styles in Silverlight 4, and the custom tabcontrol should not have any xaml of its own, just the class and the implicit xaml style in my App.xaml. I cannot, however, get this to work. This is my code: <!-- Style for generic tabcontrols --> 20,0,0,0 <Style TargetType="controls:TabItem"> <Setter Property="IsTabStop" Value="False"/> <Setter Property="Background" Value="#FFDBEDFB"/> <Setter Property="BorderBrush" Value="#FFA3AEB9"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="Padding" Value="6,2,6,2"/> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Setter Property="VerticalContentAlignment" Value="Stretch"/> <Setter Property="MinWidth" Value="5"/> <Setter Property="MinHeight" Value="5"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="controls:TabItem"> <Grid x:Name="Root" Cursor="Hand" Height="25"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualStateGroup.Transitions> <VisualTransition GeneratedDuration="0"/> <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver"/> </VisualStateGroup.Transitions> <VisualState x:Name="Normal"/> <VisualState x:Name="MouseOver"> <Storyboard> <DoubleAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="FocusVisualTop" Storyboard.TargetProperty="(UIElement.Opacity)"> <SplineDoubleKeyFrame KeyTime="0" Value="0"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualTopSelected" Storyboard.TargetProperty="(UIElement.Opacity)"> <SplineDoubleKeyFrame KeyTime="0" Value="1"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualTopUnSelected" Storyboard.TargetProperty="(UIElement.Opacity)"> <SplineDoubleKeyFrame KeyTime="0" Value="1"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> <VisualStateGroup x:Name="SelectionStates"> <VisualState x:Name="Unselected"/> <VisualState x:Name="Selected"/> </VisualStateGroup> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused"> <Storyboard> <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualTop" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Unfocused"> <Storyboard> <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"> <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <Grid x:Name="TemplateTopUnselected" Margin="1"> <Border x:Name="BorderTop" BorderThickness="1,1,1,0"> <Border x:Name="GradientTop" BorderThickness="1,1,1,0" CornerRadius="5,5,0,0"> <Border.BorderBrush> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFB1CCEE" Offset="0"/> <GradientStop Color="#CCB1CCEE" Offset="1"/> </LinearGradientBrush> </Border.BorderBrush> <Border.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFCEE0F7" Offset="0.091"/> <GradientStop Color="#FFDEECFD" Offset="0.996"/> <GradientStop Color="White"/> </LinearGradientBrush> </Border.Background> <Grid Margin="3,3,3,2"> <Grid.RowDefinitions> <RowDefinition Height="16"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="16"/> <ColumnDefinition/> <ColumnDefinition Width="15"/> </Grid.ColumnDefinitions> <Image x:Name="TabInactiveIcon" Source="group.png" Margin="0" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0.395"/> <ContentControl x:Name="HeaderTopUnselected" Cursor="{TemplateBinding Cursor}" Margin="3,0" FontSize="{TemplateBinding FontSize}" Foreground="#FF416AA3" IsTabStop="False" FontFamily="Tahoma" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/> <Button x:Name="TabInactiveCloseButton" Template="{StaticResource TabItemCloseButton}" Cursor="Hand" Height="10" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Top" Width="10" Content="Button" Grid.Column="2" d:LayoutOverrides="GridBox"/> </Grid> </Border> </Border> <Border x:Name="DisabledVisualTopUnSelected" IsHitTestVisible="false" Opacity="0" Background="#8CFFFFFF" CornerRadius="3,3,0,0"/> </Grid> <Border x:Name="FocusVisualElement" Margin="-1" IsHitTestVisible="false" Visibility="Collapsed" BorderBrush="#FF6DBDD1" BorderThickness="1" CornerRadius="3,3,0,0"/> <Grid x:Name="TemplateTopSelected" Margin="0,0,0,-3" Visibility="Collapsed"> <Border x:Name="BorderTop1" BorderThickness="1,1,1,0"> <Border x:Name="GradientTop1" BorderThickness="1,1,1,0" CornerRadius="5,5,0,0"> <Border.BorderBrush> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFB1CCEE" Offset="0"/> <GradientStop Color="#CAB1CCEE" Offset="1"/> </LinearGradientBrush> </Border.BorderBrush> <Border.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFCEE0F7" Offset="0.091"/> <GradientStop Color="White" Offset="0.974"/> <GradientStop Color="White"/> </LinearGradientBrush> </Border.Background> <Grid Margin="3,3,3,2"> <Grid.RowDefinitions> <RowDefinition Height="16"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="16"/> <ColumnDefinition/> <ColumnDefinition Width="15"/> </Grid.ColumnDefinitions> <Image x:Name="TabActiveIcon" Source="user.png" Margin="0" HorizontalAlignment="Center" VerticalAlignment="Center"/> <ContentControl x:Name="HeaderTopSelected" Cursor="{TemplateBinding Cursor}" Margin="3,0" FontSize="{TemplateBinding FontSize}" Foreground="#FF416AA3" IsTabStop="False" FontFamily="Tahoma" FontWeight="Bold" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/> <Button x:Name="TabActiveCloseButton" Template="{StaticResource TabActiveCloseButton}" Cursor="Hand" Height="10" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Top" Width="10" Content="Button" Grid.Column="2" d:LayoutOverrides="GridBox"/> </Grid> </Border> </Border> <Border x:Name="FocusVisualTop" Margin="-2,-2,-2,0" IsHitTestVisible="false" Visibility="Collapsed" BorderThickness="1,1,1,0" CornerRadius="3,3,0,0"/> <Border x:Name="DisabledVisualTopSelected" Margin="-2,-2,-2,0" IsHitTestVisible="false" Opacity="0" Background="#8CFFFFFF" CornerRadius="3,3,0,0"/> </Grid> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> and my class public class ClosableTabItem : TabItem { public static readonly DependencyProperty TabIconProperty = DependencyProperty.RegisterAttached("TabInactiveIcon", typeof(Image), typeof(ClosableTabItem), null); public Image TabIcon { get { return (Image)GetValue(ClosableTabItem.TabIconProperty); } set { SetValue(ClosableTabItem.TabIconProperty, value); } } public ClosableTabItem(string header, ContentControl content, TabItemIcons icon) { // I need to be able to set the header, content and icon here } private Image GetTabIcon(TabItemIcons icon) { Image img = new Image(); switch (icon) { case TabItemIcons.User: img.Source = new BitmapImage(new Uri("/icons/user.png", UriKind.Relative)); break; case TabItemIcons.Group: img.Source = new BitmapImage(new Uri("/icons/group.png", UriKind.Relative)); break; default: break; } return img; } } This is driving me nuts, and I can't find any examples where anyone has done this without having a xaml page for the custom tab. Is this even possible? Can someone point me in the right direction? Cheers! - jonah

    Read the article

  • Database Tutorial: The method open() is undefined for the type MainActivity.DBAdapter

    - by user2203633
    I am trying to do this database tutorial on SQLite Eclipse: https://www.youtube.com/watch?v=j-IV87qQ00M But I get a few errors at the end.. at db.ppen(); i get error: The method open() is undefined for the type MainActivity.DBAdapter and similar for insert record and close. MainActivity: package com.example.studentdatabase; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import android.app.Activity; import android.app.ListActivity; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.Toast; public class MainActivity extends Activity { /** Called when the activity is first created. */ //DBAdapter db = new DBAdapter(this); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button addBtn = (Button)findViewById(R.id.add); addBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(MainActivity.this, addassignment.class); startActivity(i); } }); try { String destPath = "/data/data/" + getPackageName() + "/databases/AssignmentDB"; File f = new File(destPath); if (!f.exists()) { CopyDB( getBaseContext().getAssets().open("mydb"), new FileOutputStream(destPath)); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } DBAdapter db = new DBAdapter(); //---add an assignment--- db.open(); long id = db.insertRecord("Hello World", "2/18/2012", "DPR 224", "First Android Project"); id = db.insertRecord("Workbook Exercises", "3/1/2012", "MAT 100", "Do odd numbers"); db.close(); //---get all Records--- /* db.open(); Cursor c = db.getAllRecords(); if (c.moveToFirst()) { do { DisplayRecord(c); } while (c.moveToNext()); } db.close(); */ /* //---get a Record--- db.open(); Cursor c = db.getRecord(2); if (c.moveToFirst()) DisplayRecord(c); else Toast.makeText(this, "No Assignments found", Toast.LENGTH_LONG).show(); db.close(); */ //---update Record--- /* db.open(); if (db.updateRecord(1, "Hello Android", "2/19/2012", "DPR 224", "First Android Project")) Toast.makeText(this, "Update successful.", Toast.LENGTH_LONG).show(); else Toast.makeText(this, "Update failed.", Toast.LENGTH_LONG).show(); db.close(); */ /* //---delete a Record--- db.open(); if (db.deleteRecord(1)) Toast.makeText(this, "Delete successful.", Toast.LENGTH_LONG).show(); else Toast.makeText(this, "Delete failed.", Toast.LENGTH_LONG).show(); db.close(); */ } private class DBAdapter extends BaseAdapter { private LayoutInflater mInflater; //private ArrayList<> @Override public int getCount() { return 0; } @Override public Object getItem(int arg0) { return null; } @Override public long getItemId(int arg0) { return 0; } @Override public View getView(int arg0, View arg1, ViewGroup arg2) { return null; } } public void CopyDB(InputStream inputStream, OutputStream outputStream) throws IOException { //---copy 1K bytes at a time--- byte[] buffer = new byte[1024]; int length; while ((length = inputStream.read(buffer)) > 0) { outputStream.write(buffer, 0, length); } inputStream.close(); outputStream.close(); } public void DisplayRecord(Cursor c) { Toast.makeText(this, "id: " + c.getString(0) + "\n" + "Title: " + c.getString(1) + "\n" + "Due Date: " + c.getString(2), Toast.LENGTH_SHORT).show(); } public void addAssignment(View view) { Intent i = new Intent("com.pinchtapzoom.addassignment"); startActivity(i); Log.d("TAG", "Clicked"); } } DBAdapter code: package com.example.studentdatabase; public class DBAdapter { public static final String KEY_ROWID = "id"; public static final String KEY_TITLE = "title"; public static final String KEY_DUEDATE = "duedate"; public static final String KEY_COURSE = "course"; public static final String KEY_NOTES = "notes"; private static final String TAG = "DBAdapter"; private static final String DATABASE_NAME = "AssignmentsDB"; private static final String DATABASE_TABLE = "assignments"; private static final int DATABASE_VERSION = 2; private static final String DATABASE_CREATE = "create table if not exists assignments (id integer primary key autoincrement, " + "title VARCHAR not null, duedate date, course VARCHAR, notes VARCHAR );"; private final Context context; private DatabaseHelper DBHelper; private SQLiteDatabase db; public DBAdapter(Context ctx) { this.context = ctx; DBHelper = new DatabaseHelper(context); } private static class DatabaseHelper extends SQLiteOpenHelper { DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { try { db.execSQL(DATABASE_CREATE); } catch (SQLException e) { e.printStackTrace(); } } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w(TAG, "Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data"); db.execSQL("DROP TABLE IF EXISTS contacts"); onCreate(db); } } //---opens the database--- public DBAdapter open() throws SQLException { db = DBHelper.getWritableDatabase(); return this; } //---closes the database--- public void close() { DBHelper.close(); } //---insert a record into the database--- public long insertRecord(String title, String duedate, String course, String notes) { ContentValues initialValues = new ContentValues(); initialValues.put(KEY_TITLE, title); initialValues.put(KEY_DUEDATE, duedate); initialValues.put(KEY_COURSE, course); initialValues.put(KEY_NOTES, notes); return db.insert(DATABASE_TABLE, null, initialValues); } //---deletes a particular record--- public boolean deleteContact(long rowId) { return db.delete(DATABASE_TABLE, KEY_ROWID + "=" + rowId, null) > 0; } //---retrieves all the records--- public Cursor getAllRecords() { return db.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE, KEY_DUEDATE, KEY_COURSE, KEY_NOTES}, null, null, null, null, null); } //---retrieves a particular record--- public Cursor getRecord(long rowId) throws SQLException { Cursor mCursor = db.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE, KEY_DUEDATE, KEY_COURSE, KEY_NOTES}, KEY_ROWID + "=" + rowId, null, null, null, null, null); if (mCursor != null) { mCursor.moveToFirst(); } return mCursor; } //---updates a record--- public boolean updateRecord(long rowId, String title, String duedate, String course, String notes) { ContentValues args = new ContentValues(); args.put(KEY_TITLE, title); args.put(KEY_DUEDATE, duedate); args.put(KEY_COURSE, course); args.put(KEY_NOTES, notes); return db.update(DATABASE_TABLE, args, KEY_ROWID + "=" + rowId, null) > 0; } } addassignment code: package com.example.studentdatabase; public class addassignment extends Activity { DBAdapter db = new DBAdapter(this); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.add); } public void addAssignment(View v) { Log.d("test", "adding"); //get data from form EditText nameTxt = (EditText)findViewById(R.id.editTitle); EditText dateTxt = (EditText)findViewById(R.id.editDuedate); EditText courseTxt = (EditText)findViewById(R.id.editCourse); EditText notesTxt = (EditText)findViewById(R.id.editNotes); db.open(); long id = db.insertRecord(nameTxt.getText().toString(), dateTxt.getText().toString(), courseTxt.getText().toString(), notesTxt.getText().toString()); db.close(); nameTxt.setText(""); dateTxt.setText(""); courseTxt.setText(""); notesTxt.setText(""); Toast.makeText(addassignment.this,"Assignment Added", Toast.LENGTH_LONG).show(); } public void viewAssignments(View v) { Intent i = new Intent(this, MainActivity.class); startActivity(i); } } What is wrong here? Thanks in advance.

    Read the article

  • VMWare Workstation 6.5.5 (64-bit) on Ubuntu 10.04 (64-bit) Odd Problem

    - by Android Eve
    I managed to successfully install VMWare Workstation 6.5.5 (64-bit) on Ubuntu 10.04 (64-bit). It works well and somehow feels faster and snappier than the same exact version on Ubuntu 8.04. However, there is one slight issue, somewhat hurting productivity: When the guest VM is Microsoft Windows (2K, XP), the mouse cursor turn from an arrow to a hand when it hovers over the Task Bar. When the mouse moves, this hand cursor blinks and the system doesn't respond to mouse clicks. When I move the mouse cursor back to the desktop area, it functions normally. That is, the problem exists only in the Task Bar area. Obviously, this makes it very difficult (read: impossible) for me to use the Start Menu, SysTray and the rest of the Task Bar. My workaround for now is to launch programs via their Desktop shortcuts or via the keyboard. Note: The same exact VMWare Workstation 6.5.5 (64-bit) on Ubuntu 8.04 (64-bit) doesn't exhibit this problem. Anyone seen this problem before? Do you know of a solution (or better workaround) to this problem?

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >