Search Results

Search found 55 results on 3 pages for 'typeface'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Class Issue (The type XXX is already defined )

    - by Android Stack
    I have listview app exploring cities each row point to diffrent city , in each city activity include button when clicked open new activity which is infinite gallery contains pics of that city , i add infinite gallery to first city and work fine , when i want to add it to the second city , it gave me red mark error in the class as follow : 1- The type InfiniteGalleryAdapter is already defined. 2-The type InfiniteGallery is already defined. i tried to change class name with the same result ,i delete R.jave and eclipse rebuild it with same result also i uncheck the java builder from project properties ,get same red mark error. please any help and advice will be appreciated thanks My Code : public class SecondCity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); // Set the layout to use setContentView(R.layout.main); if (customTitleSupported) { getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.custom_title); TextView tv = (TextView) findViewById(R.id.tv); Typeface face=Typeface.createFromAsset(getAssets(),"BFantezy.ttf"); tv.setTypeface(face); tv.setText("MY PICTURES"); } InfiniteGallery galleryOne = (InfiniteGallery) findViewById(R.id.galleryOne); galleryOne.setAdapter(new InfiniteGalleryAdapter(this)); } } class InfiniteGalleryAdapter extends BaseAdapter { **//red mark here (InfiniteGalleryAdapter)** private Context mContext; public InfiniteGalleryAdapter(Context c, int[] imageIds) { this.mContext = c; } public int getCount() { return Integer.MAX_VALUE; } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } private LayoutInflater inflater=null; public InfiniteGalleryAdapter(Context a) { this.mContext = a; inflater = (LayoutInflater)mContext.getSystemService ( Context.LAYOUT_INFLATER_SERVICE); } public class ViewHolder{ public TextView text; public ImageView image; } private int[] images = { R.drawable.pic_1, R.drawable.pic_2, R.drawable.pic_3, R.drawable.pic_4, R.drawable.pic_5 }; private String[] name = { "This is first picture (1) " , "This is second picture (2)", "This is third picture (3)", "This is fourth picture (4)", " This is fifth picture (5)", }; public View getView(int position, View convertView, ViewGroup parent) { ImageView i = getImageView(); int itemPos = (position % images.length); try { i.setImageResource(images[itemPos]); ((BitmapDrawable) i.getDrawable()). setAntiAlias (true); } catch (OutOfMemoryError e) { Log.e("InfiniteGalleryAdapter", "Out of memory creating imageview. Using empty view.", e); } View vi=convertView; ViewHolder holder; if(convertView==null){ vi = inflater.inflate(R.layout.gallery_items, null); holder=new ViewHolder(); holder.text=(TextView)vi.findViewById(R.id.textView1); holder.image=(ImageView)vi.findViewById(R.id.image); vi.setTag(holder); } else holder=(ViewHolder)vi.getTag(); holder.text.setText(name[itemPos]); final int stub_id=images[itemPos]; holder.image.setImageResource(stub_id); return vi; } private ImageView getImageView() { ImageView i = new ImageView(mContext); return i; } } class InfiniteGallery extends Gallery { **//red mark here (InfiniteGallery)** public InfiniteGallery(Context context) { super(context); init(); } public InfiniteGallery(Context context, AttributeSet attrs) { super(context, attrs); init(); } public InfiniteGallery(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } private void init(){ // These are just to make it look pretty setSpacing(25); setHorizontalFadingEdgeEnabled(false); } public void setResourceImages(int[] name){ setAdapter(new InfiniteGalleryAdapter(getContext(), name)); setSelection((getCount() / 2)); } }

    Read the article

  • Silverlight Cream for May 29, 2010 -- #872

    - by Dave Campbell
    In this Issue: Michael Washington, Chris Koenig, Kunal Chowdhury, SilverLaw, Shayne Burgess, Ian T. Lackey, Alan Beasley, Marlon Grech. Shoutouts: Ozymandias has a post up that's not Silverlight necessarily, but it's pretty cool: Typeface Selection Flowchart Damian Schenkelman posted about the latest: Prism 2.2 Release available. Get it at Codeplex. From SilverlightCream.com: Silverlight 4 OData Paging with RX Extensions Michael Washington continues with this OData and Rx post using the View Model Style. Michael has some good external links, good info, and all the code. WP7 Part 4: Morphing and Mapping Chris Koenig has the 4th in his WP7 series he's doing, and this one is on MVVMLight and BingMaps ... code included. Silverlight 4: Interoperability with Excel using the COM Object Kunal Chowdhury has a post up about Excel Interoperability using the COM object including opening an Excel Workbook and writing data out, then modifying the data in the spreadsheet and seeing it updated in the app. Creating A Flexible Surface Effect – Silverlight 4 (Part 1) SilverLaw put up a demo of an awesome 'water ripple' SL4 demo a couple days ago, and now he's got part 1 of a great tutorial explaining it all. Service Operations and the WCF Data Services Client Shayne Burgess has a post up about Service Operations and how they can be used by the WCF Data Services client. Role Based Silverlight Behaviors Also from the Open Light Group, Ian T. Lackey has a post up about Behaviors that takes a list of roles and updates the UI appropriatetly. How to Toggle (Show/Hide) using Behaviours (Behaviors) between Visual States or Storyboards in Expression Blend for Windows Phone Alan Beasley has a quick post up talking about the solution he found to a problem he was having with state switching in a WP7 app. MEFedMVVM: Testability Marlon Grech has another MEFedMVVM post up and he's discussing Testability all rolled in there with everything else :) Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • android: CheckedTextView cannot be checked?

    - by Yang
    Initially I wanted a checkmark where the text is placed on the left of the checkmark. After searching on this site I found out the best workaround is android:CheckedTextView? However, I found out that the checkmark cannot be changed manually by users. Is it by design? <CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/autoupdatecheckboxview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:checkMark="?android:attr/listChoiceIndicatorMultiple" android:paddingLeft="6dip" android:paddingRight="6dip" android:text="Pop up a message when new data available" android:typeface="sans" android:textSize="16dip"/>

    Read the article

  • Linear layout and custom dialog

    - by DixieFlatline
    The button doesn't show in this layout(code below),image and textview are shown. I tried using relative layout but that doesn't help either. I'm testing it on 1.5 emulator. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_root" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/neki" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="10dp" /> <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="fill_parent" android:textColor="#FFF" android:text="Some text " /> </LinearLayout> <Button android:id="@+id/gumbek" android:text="V redu" android:typeface="serif" android:textStyle="bold" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout>

    Read the article

  • Problem with sizes of EditText and Button in Android

    - by DixieFlatline
    I want to make the edittext width the same size as button. My EditText is currently very small. I use relative layout. <TextView android:id="@+id/aha4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="17dip" android:text="Vzdevek:" android:layout_below="@id/aha3" /> <EditText android:id="@+id/nick" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@id/nivo" android:layout_toRightOf="@id/aha4"/> <Button android:id="@+id/poslji" android:text="Pošlji" android:layout_height="wrap_content" android:layout_width="20dip" android:typeface="serif" android:textStyle="bold" android:layout_alignParentRight="true" android:layout_below="@id/nivo" android:layout_toRightOf="@id/nick"/> What i currently get is this: What is the appropriate layout_width for edittext and button?

    Read the article

  • How to control allowed HTML tags in WMD Editor?

    - by Toto
    I am trying to some-how set the valid HTML tags and attributes users would be able to use in WMD Editor in my site. For example, I want to forbid the user to directly set the font size, color, typeface and so on, which is trivial to do with the default settings typing something like: <span style="font-size: 45px; color:#FF0000">Some intrusive text here</span>. I think the way to implement this is through the "wmd_options", but I have not found any documentation or reference regarding this, giving the fact that the 'Options demo' seems to be the only public documentation and it does not show how should I do what I have described above. I've send this same question to [email protected] but didn't get any reply. As stackoverflow uses this editor someone reading this or maybe Jeff knows the answer ;) Thanks in advance!

    Read the article

  • How to make a DropDownList control display some items in bold ASP.Net

    - by james lewis
    I'm working with a custom DropDownList control in ASP.Net and there's been a request to display certain items in the list with a bold typeface (NOTE - the control inherits from CompositeDataBoundControl so it can be data bound... not DropDownListBox). The control is bound to a table and there's a column in the table named IsUsed - if this is set to true, the corresponding item in the list should be rendered bold. (It should be noted here that this will only ever be viewed in FireFox.) My experience is all in the middle \ backend tiers so the presentation layer is very new to me - can someone point me in the right direction? My initial thought was that somewhere in the custom control I would have access to all the rows that are returned from the data source which I could cycle through etc but I'm not sure if that's possible... There's also RenderContents which I can override... looks interesting! Any help appreciated - cheers. James

    Read the article

  • Using a FormattedText object, how do I find out how much of my text was actually displayed?

    - by Robert
    If I have code like this: FormattedText text = new FormattedText(sTheBook, System.Globalization.CultureInfo.CurrentUICulture, System.Windows.FlowDirection.LeftToRight, new Typeface("Times New Roman"), 13, Brushes.Black); text.MaxTextWidth = 300; text.MaxTextHeight = 600; text.TextAlignment = TextAlignment.Justify; dc.DrawText(text, new Point(10, 0)); ...then, if it is long, only some of the text that I passed in (via sTheBook) will be displayed on the screen. I need to know how much was displayed so I can display the rest later! I can easily measure an amount of text, but it seems silly to do a search by rendering and re-rendering my text over and over until I find the piece that fits exactly. Thanks!

    Read the article

  • Change Toast Font

    - by mgpyone
    Currently, I'm trying to develop an app. and I don't know how to change the Toast font. . final OnClickListener clickListener = new OnClickListener() { public void onClick(View v) { try { Toast.makeText(nova.this,"Hello", 500000).show(); } catch (Exception e) { Toast.makeText(nova.this,"Exception:" +e, 500000); } } }; I want to change the text "Hello" with custom font I've tried with TypeFace. and Then, I want to set a variable at the place "TextClicked" .. I've tried with a local variable .. but it doesn't work any help with example source code will be really great for me.

    Read the article

  • How to draw RTL text (Arabic) onto a Bitmap and have it ordered properly?

    - by Casey
    I'm trying to draw Arabic text onto a Bitmap for display: Bitmap img = Bitmap.createBitmap( (int) f+100, 300, Config.RGB_565); Canvas c = new Canvas(); c.setBitmap( img ); mFace = Typeface.createFromAsset(getAssets(),"DejaVuSansCondensed.ttf"); mPaint.setTypeface(mFace); content = "????"; content = ArabicUtilities.reshape( content ); System.out.println("Drawing text: " + content); c.drawText(content, 30, 30, mPaint); The ArabicUtilities class is a tool to reshape the unicode text so the letters are connected. see: http://github.com/agawish/Better-Arabic-Reshaper/ However, the bitmap that is generated looks like this: When it should look like ???? I believe the issue is because, unlike a TextView, the Bitmap class is not BiDi aware, so it draws the letters from left to write. Try as I might, I can't figure out how to draw the text in the correct order.

    Read the article

  • Using TextOptions.TextFormattingMode with FormattedText

    - by dan gibson
    With WPF4 you can have non-blurry text by adding TextOptions.TextFormattingMode="Display" and TextOptions.TextRenderingMode="Aliased" to your xaml: <Window TextOptions.TextFormattingMode="Display" TextOptions.TextRenderingMode="Aliased"> This works fine for me except for when I draw text with DrawingContext.DrawText like this: void DrawText(DrawingContext dc) { FormattedText ft = new FormattedText("Hello World", System.Globalization.CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, new Typeface(FontFamily, FontStyle, FontWeight, FontStretch), FontSize, brush); dc.DrawText(ft, new Point(rect.Left, rect.Top)); } How can I draw non-blurry text with FormattedText? ie I want TextOptions.TextFormattingMode="Display" and TextOptions.TextRenderingMode="Aliased" to be used.

    Read the article

  • Showing ImageView next to TextView in a ListView

    - by KDEx
    So I have a listview that is displaying correctly. When the item is "turned on" the text is white and when it's turned off it's grey. That part all functions great. However when I add the ImageView into the mix I get a null pointer exception. I don't understand why. I've tried using bitmaps as well and get the same problem. Here is some code: @Override public void bindView(View view, Context context, Cursor cursor) { TextView rRule = (TextView) view.findViewById(R.id.rule_text); TextView rType = (TextView) view.findViewById(R.id.rule_type); ImageView iChecked = (ImageView) view.findViewById(R.id.checkBox); String ruleName = cursor.getString(1); int ruleType = cursor.getInt(2); String ruleEnabled = cursor.getString(3); switch (ruleType) { /*...some irrelevant code */ } if (ruleEnabled.equals("true")) { rRule.setTypeface(null, Typeface.BOLD); rRule.setTextColor(Color.WHITE); iChecked.setVisibility(View.VISIBLE); //line 271 } else if (ruleEnabled.equals("false")) { rRule.setTypeface(null, Typeface.NORMAL); rRule.setTextColor(Color.GRAY); iChecked.setVisibility(View.GONE); } rRule.setText(ruleName); } Per request the error log: (Sorry was under the impression null pointers dont say anything helpful..I know the error is the imageview) 06-29 10:29:02.777: E/AndroidRuntime(29516): FATAL EXCEPTION: main 06-29 10:29:02.777: E/AndroidRuntime(29516): java.lang.NullPointerException 06-29 10:29:02.777: E/AndroidRuntime(29516): at com.company.app.DefaultRulesList$RulesAdapter.bindView(DefaultRulesList.java:271) 06-29 10:29:02.777: E/AndroidRuntime(29516): at com.company.app.DefaultRulesList$RulesAdapter.newView(DefaultRulesList.java:284) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.CursorAdapter.getView(CursorAdapter.java:246) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.AbsListView.obtainView(AbsListView.java:2033) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.ListView.makeAndAddView(ListView.java:1772) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.ListView.fillDown(ListView.java:672) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.ListView.fillFromTop(ListView.java:732) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.ListView.layoutChildren(ListView.java:1625) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.AbsListView.onLayout(AbsListView.java:1863) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.View.layout(View.java:11278) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewGroup.layout(ViewGroup.java:4224) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.onLayout(LinearLayout.java:1399) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.View.layout(View.java:11278) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewGroup.layout(ViewGroup.java:4224) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.FrameLayout.onLayout(FrameLayout.java:431) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.View.layout(View.java:11278) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewGroup.layout(ViewGroup.java:4224) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.onLayout(LinearLayout.java:1399) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.View.layout(View.java:11278) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewGroup.layout(ViewGroup.java:4224) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.FrameLayout.onLayout(FrameLayout.java:431) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.View.layout(View.java:11278) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewGroup.layout(ViewGroup.java:4224) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1489) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.os.Handler.dispatchMessage(Handler.java:99) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.os.Looper.loop(Looper.java:137) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.app.ActivityThread.main(ActivityThread.java:4424) 06-29 10:29:02.777: E/AndroidRuntime(29516): at java.lang.reflect.Method.invokeNative(Native Method) 06-29 10:29:02.777: E/AndroidRuntime(29516): at java.lang.reflect.Method.invoke(Method.java:511) 06-29 10:29:02.777: E/AndroidRuntime(29516): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-29 10:29:02.777: E/AndroidRuntime(29516): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-29 10:29:02.777: E/AndroidRuntime(29516): at dalvik.system.NativeStart.main(Native Method) Code for iChecked (where the id is called) <ImageView android:id="@+id/checkBox" android:padding="2dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:drawable/checkbox_on_background"/>

    Read the article

  • Basic Android game loop having issues

    - by WillDaBeast509
    I've set up a very basic game loop that should draw a circle, run 100 times, then draw another. I also have a text field that should display how many times the loop has ran. However, the screen seems to not update. It displays a different value for the tick count (different each time the app is ran) and simply stays there. After exiting the app, I get an error saying "Unfortunately, MyApp has stopped." Here is the relevant code: DrawView public class DrawView extends SurfaceView implements SurfaceHolder.Callback { Paint p = new Paint(); MainThread thread; private int y=0; public DrawView(Context c) { super(c); thread = new MainThread(this, getHolder()); thread.running = true; getHolder().addCallback(this); setFocusable(true); } public void draw(Canvas c) { if(c==null) return; //super.onDraw(c); c.drawColor(Color.WHITE); p.setColor(Color.RED); p.setTextSize(32); p.setTypeface(Typeface.SANS_SERIF); c.drawCircle(getWidth()/2-100,getHeight()/2, 50, p); c.drawText("y = " + y, 50, 50, p); if(y>=100) { Log.i("DRAW", "drawing circle"); c.drawCircle(getWidth()/2+100,getHeight()/2, 50, p); } else y++; Log.i("INFO", "y = " + y); } @Override public boolean onTouchEvent(MotionEvent event) { return true; } public void onDraw(Canvas c){} public void surfaceCreated(SurfaceHolder p1) { thread.start(); } public void surfaceChanged(SurfaceHolder p1, int p2, int p3, int p4) { // TODO: Implement this method } public void surfaceDestroyed(SurfaceHolder p1) { thread.running = false; boolean retry = true; while (retry) { try { thread.join(); retry = false; } catch (InterruptedException e) { Log.i("EX", "cathing exception"); } } } } MainThread public class MainThread extends Thread { private DrawView page; private SurfaceHolder holder; public boolean running; public MainThread(DrawView p, SurfaceHolder h) { super(); page = p; holder = h; } @Override public void run() { while(running) { Canvas c = holder.lockCanvas(); page.draw(c); holder.unlockCanvasAndPost(c); } } } Here is an example log outupt: http://pastebin.com/tM9dUPuk It counts the number of ticks correctly and should draw the second circle, but the screen looks like its not updating. After closing the app, the log continues to run and keep outputting "y = 100 drawing circle" until it crashes and shows the error report. What is going on and how can I fix these two problems?

    Read the article

  • Sending formatted Lotus Notes rich text email from Excel VBA

    - by Lunatik
    I have little Lotus Script or Notes/Domino knowledge but I have a procedure, copied from somewhere a long time ago, that allows me to email through Notes from VBA. I normally only use this for internal notifications where the formatting hasn't really mattered. I now want to use this to send external emails to a client, and corporate types would rather the email complied with our style guide (a sans-serif typeface basically). I was about to tell them that the code only works with plain text, but then I noticed that the routine does reference some sort of CREATERICHTEXTITEM object. Does this mean I could apply some sort of formatting to the body text string after it has been passed to the mail routine? As well as upholding our precious brand values, this would be quite handy to me for highlighting certain passages in the email. I've had a dig about the 'net to see if this code could be adapted, but being unfamiliar with Notes' object model, and the fact that online Notes resources seem to mirror the application's own obtuseness, meant I didn't get very far. The code: Sub sendEmail(EmailSubject As String, EMailSendTo As String, EMailBody As String, MailServer as String) Dim objNotesSession As Object Dim objNotesMailFile As Object Dim objNotesDocument As Object Dim objNotesField As Object Dim sendmail As Boolean 'added for integration into reporting tool Dim dbString As String dbString = "mail\" & Application.UserName & ".nsf" On Error GoTo SendMailError 'Establish Connection to Notes Set objNotesSession = CreateObject("Notes.NotesSession") On Error Resume Next 'Establish Connection to Mail File Set objNotesMailFile = objNotesSession.GETDATABASE(MailServer, dbString) 'Open Mail objNotesMailFile.OPENMAIL On Error GoTo 0 'Create New Memo Set objNotesDocument = objNotesMailFile.createdocument Dim oWorkSpace As Object, oUIdoc As Object Set oWorkSpace = CreateObject("Notes.NotesUIWorkspace") Set oUIdoc = oWorkSpace.CurrentDocument 'Create 'Subject Field' Set objNotesField = objNotesDocument.APPENDITEMVALUE("Subject", EmailSubject) 'Create 'Send To' Field Set objNotesField = objNotesDocument.APPENDITEMVALUE("SendTo", EMailSendTo) 'Create 'Copy To' Field Set objNotesField = objNotesDocument.APPENDITEMVALUE("CopyTo", EMailCCTo) 'Create 'Blind Copy To' Field Set objNotesField = objNotesDocument.APPENDITEMVALUE("BlindCopyTo", EMailBCCTo) 'Create 'Body' of memo Set objNotesField = objNotesDocument.CREATERICHTEXTITEM("Body") With objNotesField .APPENDTEXT emailBody .ADDNEWLINE 1 End With 'Send the e-mail Call objNotesDocument.Save(True, False, False) objNotesDocument.SaveMessageOnSend = True 'objNotesDocument.Save objNotesDocument.Send (0) 'Release storage Set objNotesSession = Nothing Set objNotesMailFile = Nothing Set objNotesDocument = Nothing Set objNotesField = Nothing 'Set return code sendmail = True Exit Sub SendMailError: Dim Msg Msg = "Error # " & Str(Err.Number) & " was generated by " _ & Err.Source & Chr(13) & Err.Description MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext sendmail = False End Sub

    Read the article

  • Marquee in various TextView at the same time?

    - by YaW
    Hi, I have a dinamic layout wich has one to six TextViews. All the TextViews are created in the Activity (programatically) and all are created equally. I want to marquee the text in the TextViews, but I don't know how to do it. Apparently, the TextView needs to be focused for the marquee works fine, but how i focus six TextViews at the same time? I think that's not possible, so, is there any workaround? Is it possible to get the marquee working without having the focus? This is the code of the TextViews: //TextView TextView tvTitulo = new TextView(this); tvTitulo.setText("Some loooooooooooooooooooooong text"); tvTitulo.setTypeface(null, Typeface.BOLD); //Marquee tvTitulo.setSingleLine(); tvTitulo.setEllipsize(TruncateAt.MARQUEE); tvTitulo.setHorizontallyScrolling(true); tvTitulo.setFocusableInTouchMode(true); If I remove the line tvTitulo.setFocusableInTouchMode(true); the marquee is not working at all. If I don't remove the line, only one of the TextViews is getting the marquee working. Greetings

    Read the article

  • Are Fortran control characters (carriage control) still implemented in compilers?

    - by CmdrGuard
    In the book Fortran 95/2003 for Scientists and Engineers, there is much talk given to the importance of recognizing that the first column in a format statement is reserved for control characters. I've also seen control characters referred to as carriage control on the internet. To avoid confusion, by control characters, I refer to the characters "1, a blank (i.e. \s), 0, and +" as having an effect on the vertical spacing of output when placed in the first column (character) of a FORMAT statement. Also, see this text-only web page written entirely in fixed-width typeface : Fortran carriage-control (because nothing screams accuracy and antiquity better than prose in monospaced font). I found this page and others like it to be not quite clear. According to Fortran 95/2003 for Scientists and Engineers, failure to recall that the first column is reserved for carriage control can lead to horrible unintended output. Paraphrasing Dave Barry, type the wrong character, and nuclear missiles get fired at Norway. However, when I attempt to adhere to this stern warning, I find that gfortran has no idea what I'm talking about. Allow me to illustrate my point with some example code. I am trying to print out the number Pi: PROGRAM test_format IMPLICIT NONE REAL :: PI = 2 * ACOS(0.0) WRITE (*, 100) PI WRITE (*, 200) PI WRITE (*, 300) PI 100 FORMAT ('1', "New page: ", F11.9) 200 FORMAT (' ', "Single Space: ", F11.9) 300 FORMAT ('0', "Double Space: ", F11.9) END PROGRAM test_format This is the output: 1New page: 3.141592741 Single Space: 3.141592741 0Double Space: 3.141592741 The "1" and "0" are not typos. It appears that gfortran is completely ignoring the control character column. My question, then, is this: Are control characters still implemented in standards compliant compilers or is gfortran simply not standards compliant? For clarity, here is the output of my gfortran -v Using built-in specs. Target: powerpc-apple-darwin9 Configured with: ../gcc-4.4.0/configure --prefix=/sw --prefix=/sw/lib/gcc4.4 --mandir=/sw/share/man --infodir=/sw/share/info --enable-languages=c,c++,fortran,objc,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --disable-libjava-multilib --build=powerpc-apple-darwin9 --host=powerpc-apple-darwin9 --target=powerpc-apple-darwin9 Thread model: posix gcc version 4.4.0 (GCC)

    Read the article

  • ListView Parsing Persian xml

    - by Namikaze Minato
    I used a tutorial about listview parsing xm from internet and using LasyAdapter shows the items in listview. When I add persian characters in xml (into one of childnodes) the result is some boxes in listview (after showing the text in listview). The format of xml is UTF-8, too. I used typeface too (but didn't work). Besides when I type Pwesian into the application it shows alright but it can't show Persiann content parsed from xml. Thanks in advance. I updated the post with original XMLparser (which was the problem). public String getXmlFromUrl(String url) { String xml = null; try { // defaultHttpClient DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(url); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); xml = EntityUtils.toString(httpEntity); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } // return XML return xml; } public Document getDomElement(String xml) { Document doc = null; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { DocumentBuilder db = dbf.newDocumentBuilder(); InputSource is = new InputSource(); is.setCharacterStream(new StringReader(xml)); doc = db.parse(is); } catch (ParserConfigurationException e) { Log.e("Error: ", e.getMessage()); return null; } catch (SAXException e) { Log.e("Error: ", e.getMessage()); return null; } catch (IOException e) { Log.e("Error: ", e.getMessage()); return null; } return doc; }

    Read the article

  • What are the best practices for writing maintainable CSS?

    - by Art
    I am just starting to explore this area and wonder what are the best practices when it comes to production of clean, well-structured and maintainable CSSes. There seems to be few different approaches to structuring CSS rules. One of the most commonly encountered ones I saw was throwing everything together in one rule, i.e. margins, borders, typefaces, backgrounds, something like this: .my-class { border-top:1px solid #c9d7f1; font-size:1px; font-weight:normal; height:0; position:absolute; top:24px; width:100%; } Another approach I noticed employed grouping of properties, say text-related properties like font-size, typeface, emphasis etc goes into one rule, backgrounds go into other, borders/margins go into yet another one: .my-class { border-top:1px solid #c9d7f1; } .my-class { font-size:1px; font-weight:normal; } .my-class { height:0; top:24px; width:100%; position:absolute; } I guess I am looking for a silver bullet here which I know I am not going to get, bet nevertheless - what are the best practices in this space?

    Read the article

  • TextColor not showing when row backgroundcolor set

    - by RuAware
    if my row is colored red the text wont set to green and bold italic. When debugging I can see it telling the TextView to set each textViews setting. Thanks TableRow row = new TableRow(getContext()); row.setLayoutParams(new TableRow.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); String[] items = list.get(l).split(":"); for(int i=0; i < items.length; i++){ //see if i need to colour row if(items[i].startsWith("colorme_") == true) { if (items[i].substring(8).equals("red") == true) { row.setBackgroundColor(Color.RED); } } else { //create a temp textview then add to row TextView tempTV = new TextView(getContext()); tempTV.setText(items[i].toString()); //test against correct answers and colour text view green if correct if (correctAnswers != null && correctAnswers.size() > i) { if (correctAnswers.get(i).equals(items[i].toString()) == true) { tempTV.setTextColor(Color.GREEN); tempTV.setTypeface(null, Typeface.BOLD_ITALIC); } } row.addView(tempTV,lpTextView); } } //add the row tempTable.addView(row);

    Read the article

  • Change clickable TextView's color on focus and click?

    - by Daniel Jonsson
    I have a clickable TextView that I want to give some colors to. But I don't know how. Here are the relevant code snippets from my two files that I'm working with: TextView title = new TextView(this); title.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); title.setTextColor(R.color.textcolor); title.setText(titleLine); title.setTypeface(null, Typeface.BOLD); title.setClickable(true); title.setId(idLine); title.setFocusable(true); title.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { /* Irrelevant code */ } }); And this is my textcolor.xml file: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:color="#000000"/> <!-- pressed --> <item android:state_focused="true" android:color="#000000"/> <!-- focused --> <item android:color="#000000"/> <!-- default --> </selector> When I use the textcolor-file by typing title.setTextColor(R.color.textcolor);, the textcolor just becomes grey, regardless if I press it or so. Which is strange since I have written "#000000" in all color fields. But if I remove the setTextColor code, gets the textView a light grey color, and when I press it, it becomes black. But that aren't the colors that I want. So, can anyone help me with this problem? Just to clarify: I want to be able to specify the colors for the text when it's normal, pressed and focused.

    Read the article

  • How can I get the Terminal raster font to display alt codes in a text editor?

    - by grg-n-sox
    I am working on a project that includes making some ASCII art, except it isn't true ASCII art since I am using a far amount of Windows Alt codes to make it. Anyways, I wanted to make sure that as I am working on it, that it looks exactly how it will in a windows command prompt terminal session. So since command prompt defaults to the Terminal raster font, I figured I would use that. But I quickly noticed that when I use the Terminal typeface in a text editor, it will not render ASCII codes, either at all (as is the case most of the time) or incorrectly. Now, I understand if a font just doesn't support non-ASCII characters, but what I don't get is how the characters do show up correctly in command prompt when they don't in a text editor. I checked the output of the 'chcp' and it was set to 437 by default, which is what I need. Well, either that or 850 but preferably 437 since they got rid of some of the graphics in 437 and replaced them with other Latin characters. Command prompt terminal settings show I am using the Terminal raster font with a 8x12 glyph size. So I try using size 12 in the text editor but no good, even after switching the text encoding to either MS-DOS OEM-US (supposedly an alternative name for CP437) or UTF-8. I just don't get how I am not getting the characters to show up. Also, if it helps, the art I am making is basically modified screen shots from a game I play called Dwarf Fortress that uses characters from the Terminal/Curses typeset, or at least that is how it is reported in the forums by those who make graphics sets to replace the default character set. However, the game doesn't actually use the system's Terminal font. The game's data files includes a bitmap image that is a grid of all the characters the game uses. So it uses this bitmap to render graphics instead of the actual font file. And I basically want to get a text editor to make it so if I type up some ASCII art to look like a screenshot from Dwarf Fortress, that it will actually look like Dwarf Fortress other than the lack of color. Any help?

    Read the article

  • How to Customize Fonts and Colors for Gnome Panels in Ubuntu Linux

    - by The Geek
    Earlier this week we showed you how to make the Gnome Panels totally transparent, but you really need some customized fonts and colors to make the effect work better. Here’s how to do it. This article is the first part of a multi-part series on how to customize the Ubuntu desktop, written by How-To Geek reader and ubergeek, Omar Hafiz. Changing the Gnome Colors the Easy Way You’ll first need to install Gnome Color Chooser which is available in the default repositories (the package name is gnome-color-chooser). Then go to System > Preferences > Gnome Color Chooser to launch the program. When you see all these tabs you immediately know that Gnome Color Chooser does not only change the font color of the panel, but also the color of the fonts all over Ubuntu, desktop icons, and many other things as well. Now switch to the panel tab, here you can control every thing about your panels. You can change font, font color, background and background color of the panels and start menus. Tick the “Normal” option and choose the color you want for the panel font. If you want you can change the hover color of the buttons on the panel by too. A little below the color option is the font options, this includes the font, font size, and the X and Y positioning of the font. The first two options are pretty straight forward, they change the typeface and the size. The X-Padding and Y-Padding may confuse you but they are interesting, they may give a nice look for your panels by increasing the space between items on your panel like this: X-Padding:   Y-Padding:   The bottom half of the window controls the look of your start menus which is the Applications, Places, and Systems menus. You can customize them just the way you did with the panel.   Alright, this was the easy way to change the font of your panels. Changing the Gnome Theme Colors the Command-Line Way The other hard (not so hard really) way will be changing the configuration files that tell your panel how it should look like. In your Home Folder, press Ctrl+H to show the hidden files, now find the file “.gtkrc-2.0”, open it and insert this line in it. If there are any other lines in the file leave them intact. include “/home/<username>/.gnome2/panel-fontrc” Don’t forget to replace the <user_name> with you user account name. When done close and save the file. Now navigate the folder “.gnome2” from your Home Folder and create a new file and name it “panel-fontrc”. Open the file you just created with a text editor and paste the following in it: style “my_color”{fg[NORMAL] = “#FF0000”}widget “*PanelWidget*” style “my_color”widget “*PanelApplet*” style “my_color” This text will make the font red. If you want other colors you’ll need to replace the Hex value/HTML Notation (in this case #FF0000) with the value of the color you want. To get the hex value you can use GIMP, Gcolor2 witch is available in the default repositories or you can right-click on your panel > Properties > Background tab then click to choose the color you want and copy the Hex value. Don’t change any other thing in the text. When done, save and close. Now press Alt+F2 and enter “killall gnome-panel” to force it to restart or you can log out and login again. Most of you will prefer the first way of changing the font and color for it’s ease of applying and because it gives you much more options but, some may not have the ability/will to download and install a new program on their machine or have reasons of their own for not to using it, that’s why we provided the two way. Latest Features How-To Geek ETC How to Enable User-Specific Wireless Networks in Windows 7 How to Use Google Chrome as Your Default PDF Reader (the Easy Way) How To Remove People and Objects From Photographs In Photoshop Ask How-To Geek: How Can I Monitor My Bandwidth Usage? Internet Explorer 9 RC Now Available: Here’s the Most Interesting New Stuff Here’s a Super Simple Trick to Defeating Fake Anti-Virus Malware The Splendiferous Array of Culinary Tools [Infographic] Add a Real-Time Earth Wallpaper App to Ubuntu with xplanetFX The Citroen GT – An Awesome Video Game Car Brought to Life [Video] Final Man vs. Machine Round of Jeopardy Unfolds; Watson Dominates Give Chromium-Based Browser Desktop Notifications a Native System Look in Ubuntu Chrome Time Track Is a Simple Task Time Tracker

    Read the article

  • WPF Converter and NotifyOnTargetUpdated exclusive in a binding ?

    - by Mathieu Garstecki
    Hi, I have a problem with a databinding in WPF. When I try to use a value converter and set the NotifyOnTargetUpdated=True property to True, I get an XamlParseException with the following message: 'System.Windows.Data.BindingExpression' value cannot be assigned to property 'Contenu' of object 'View.UserControls.ShadowedText'. Value cannot be null. Parameter name: textToFormat Error at object 'System.Windows.Data.Binding' in markup file 'View.UserControls;component/saletotal.xaml' Line 363 Position 95. The binding is pretty standard: <my:ShadowedText Contenu="{Binding Path=Total, Converter={StaticResource CurrencyToStringConverter}, NotifyOnTargetUpdated=True}" TargetUpdated="MontantTotal_TargetUpdated"> </my:ShadowedText> (Styling properties removed for conciseness) The converter exists in the resources and works correctly when NotifyOnTargetUpdated=True is removed. Similarly, the TargetUpdated event is called and implemented correctly, and works when the converter is removed. Note: This binding is defined in a ControlTemplate, though I don't think that is relevant to the problem. Can anybody explain me what is happening ? Am I defining the binding wrong ? Are those features mutually exclusive (and in this case, can you explain why it is so) ? Thanks in advance. More info: Here is the content of the TargetUpdated handler: private void MontantTotal_TargetUpdated(object sender, DataTransferEventArgs e) { ShadowedText textBlock = (ShadowedText)e.TargetObject; double textSize = textBlock.Taille; double delta = 5; double defaultTaille = 56; double maxWidth = textBlock.MaxWidth; while (true) { FormattedText newFormat = new FormattedText(textBlock.Contenu, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, new Typeface("Calibri"), textSize, (SolidColorBrush) Resources["RougeVif"]); if (newFormat.Width < textBlock.MaxWidth && textSize <= defaultTaille) { if ((Math.Round(newFormat.Width) + delta) >= maxWidth || textSize == defaultTaille) { break; } textSize++; } else { if ((Math.Round(newFormat.Width) - delta) <= maxWidth && textSize <= defaultTaille) { break; } textSize--; } } textBlock.Taille = textSize; } The role of the handler is to resize the control based on the length of the content. It is quite ugly but I want to have the functional part working before refactoring.

    Read the article

  • Android relative layout problem

    - by DixieFlatline
    Hello! I just can't display the button at the bottom of the screen. I have 2 textviews and 2 edittexts set as gone, and they become visible when user clicks checkbox. It's only then that my button gets positioned properly Otherwise it sits on top of the app at launch of my app.(see here: http://www.shrani.si/f/3V/10G/4nnH4DtV/layoutproblem.png) I also tried android:layout_alignParentBottom="true" but that doesnt help either. <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="wrap_content"> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/txt1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Krajevna skupnost: " android:layout_alignParentTop="true" /> <Spinner android:id="@+id/spinner1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:prompt="@string/ks_prompt" android:layout_below="@id/txt1" /> <TextView android:id="@+id/txt2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Zadeva: " android:layout_below="@id/spinner1" /> <Spinner android:id="@+id/spinner2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:prompt="@string/pod_prompt" android:layout_below="@id/txt2" /> <TextView android:id="@+id/tv1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Zadeva: " android:layout_below="@id/spinner2" /> <EditText android:id="@+id/prvi" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tv1" /> <TextView android:id="@+id/tv2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/prvi" android:text="Vsebina: " /> <EditText android:id="@+id/drugi" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tv2" /> <CheckBox android:id="@+id/cek" android:text="Obvešcaj o odgovoru" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/drugi" /> <TextView android:id="@+id/tv3" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/cek" android:text="Email: " android:visibility="gone"/> <EditText android:id="@+id/tretji" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tv3" android:visibility="gone" /> <TextView android:id="@+id/tv4" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tretji" android:visibility="gone" android:text="Telefon: " /> <EditText android:id="@+id/cetrti" android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone" android:layout_below="@id/tv4" /> <Button android:id="@+id/gumb" android:text="Klikni" android:typeface="serif" android:textStyle="bold" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_below="@id/cetrti" /> </RelativeLayout> </ScrollView>

    Read the article

  • Drawing text to <canvas> with @font-face does not work at the first time

    - by lemonedo
    Hi all, First try the test case please: http://lemon-factory.net/test/font-face-and-canvas.html I'm not good at English, so I made the test case to be self-explanatory. On the first click to the DRAW button, it will not draw text, or will draw with an incorrect typeface instead of the specified "PressStart", according to your browser. After then it works as expected. At the first time the text does not appear correctly in all browsers I've tested (Firefox, Google Chrome, Safari, Opera). Is it the standard behavior or something? Thank you. PS: Following is the code of the test case <!DOCTYPE html> <html> <head> <meta http-equiv=Content-Type content="text/html;charset=utf-8"> <title>@font-face and canvas</title> <style> @font-face { font-family: 'PressStart'; src: url('http://lemon-factory.net/css/fonts/prstart.ttf'); } canvas, pre { border: 1px solid #666; } pre { float: left; margin: .5em; padding: .5em; } </style> </head> <body> <div> <canvas id=canvas width=250 height=250> Your browser does not support the CANVAS element. Try the latest Firefox, Google Chrome, Safari or Opera. </canvas> <button>DRAW</button> </div> <pre id=style></pre> <pre id=script></pre> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> var canvas = document.getElementById('canvas') var ctx = canvas.getContext('2d') var x = 30 var y = 10 function draw() { ctx.font = '12px PressStart' ctx.fillStyle = '#000' ctx.fillText('Hello, world!', x, y += 20) ctx.fillRect(x - 20, y - 10, 10, 10) } $('button').click(draw) $('pre#style').text($('style').text()) $('pre#script').text($('script').text()) </script> </body> </html>

    Read the article

< Previous Page | 1 2 3  | Next Page >