Cursor is not moving when entering text [closed] - blackberry

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am usuing edit field, but when I type any text in this field, then cursor in not moving with the text, It is showing typed text, but cursor position still remains on start .
I am using Os 6 and Os 7/7.1.
Please let me know for the problem.
Following is the image for it.

I have added following code - onFocus and onUnFocus methods to the text field:
protected void onFocus(int direction) {
this.setCursorPosition(this.getTextLength());
invalidate();
super.onFocus(direction);
};
protected void onUnfocus() {
this.setCursorPosition(this.getTextLength());
invalidate();
super.onUnfocus();
};
It has solved my problem.
Thanks to all for your support.

Related

How to implement bootstrap datepicker with text_field? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to use a bootstrap datepicker with my text_field inside form_for.
How should I rewrite
<%= f.text_field :some_date %>
line to store the selected date in some_date field?
date time picker just support input type for direct integration. but rails text_field create text area. So you can't do so directly.
You can either integrate datetimepicker onclick or mousedown event. Like we can do for div/span.
If you want to do so you need to override datetimepicker code which check for supported html elements.
code below which should change : link here
attachDatePickerElementEvents = function () {
input.on({
'change': change,
'blur': options.debug ? '' : hide,
'keydown': keydown,
'keyup': keyup,
'focus': options.allowInputToggle ? show : ''
});
if (element.is('input')) {
input.on({
'focus': show
});
} else if (component) {
component.on('click', toggle);
component.on('mousedown', false);
}
},
See this Demo & code and API
$('field selector').datepicker({
});

ViewBag does not show new line [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I want to show text on two separate lines for the page header:
#section featured {
<section class="featured">
<div class="content-wrapper">
<hgroup class="title">
<h1>#ViewBag.Message</h1>
</hgroup>
</div>
</section>
}
I have the following code in controller:
public ActionResult Login(string returnUrl)
{
StringBuilder sb = new StringBuilder();
sb.Append("Web Security Administration Portal");
sb.AppendLine();
sb.AppendLine();
sb.Append("Services, Inc. - SSOAdmin v2.00");
ViewBag.ReturnUrl = returnUrl;
ViewBag.Message = sb.ToString();
return View();
}
ViewBag does not show new line. When viewing source code of generated html, looks like that two strings are on separated lines, but when page is rendered, lines are not separated.
I tried to use sb.Append(Environment.NewLine) and sb.Append(Text{0}, Environment.NewLIne) as well. Does not help here.
What can be wrong here?
Environment.NewLine puts the text on multiple lines in the HTML that is created. However, white space such as new lines are ignored by most HTML elements. You should add <br /> where you want new lines.
Alternately, you could change that behavior by adding see to the enclosing element that adds:
white-space: pre-wrap;
The best bet to get that to work would be to have your ViewBag be wrapped in a <p>.

from Javascript to CoffeeScript [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
How to write this javascript code in coffeeScript?
$('#id_tab a').click(function (e) {
$('ul.nav-tabs li.active').removeClass('active')
$(this).parent('li').addClass('active')
})
It works when i put it in my html.erb file
So I try this in the coffeeScript file:
$ ->
$('#id_tab a').click (e) ->
$('ul.nav-tabs li.active').removeClass 'active'
$(this).parent('li').addClass 'active'
And it doesn't work.
Please help!
There is a nice site called JS2Coffee which you can use to check your script. You'll see that your coffee script compiles to:
$(function() {
return $('#id_tab a').click(function(e) {
$('ul.nav-tabs li.active').removeClass('active');
return $(this).parent('li').addClass('active');
});
});
Instead, try this:
$ ->
$('#id_tab a').click (e) ->
$('ul.nav-tabs li.active').removeClass 'active'
$(this).parent('li').addClass 'active'
true
true
You can view this StackOveflow answer for more information, but Coffeescript always returns the last line.

Activex control for web print [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I would like to find an Internet Explorer ActiveX control that will allow me to print a web page or part of web page to a specific printer without a dialog box.
Is there any activex plugin to achieve this?
I used ScriptX. The free version lets you set some basic parameters, see the example below.
Example:
<!-- MeadCo ScriptX -->
<object id=factory style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
codebase="http://[your path here]/smsx.cab#Version=7.0.0.8 ">
</object>
<script>
function printWindow() {
factory.printing.header = "This is MeadCo";
factory.printing.footer = "Printing by ScriptX";
factory.printing.portrait = false;
factory.printing.leftMargin = 1.0;
factory.printing.topMargin = 1.0;
factory.printing.rightMargin = 1.0;
factory.printing.bottomMargin = 1.0;
factory.printing.Print(false);
}
</script>

Visual Studio Addin: How to know if already opened document got focus?

I'm very much newbie to VS Addins.
Although, I subscribed to DocumentEvent.DocumentOpened. But additionally, I need to detect if already opened document got focus and I will read its contents then.
How to get its focused state?
Thanks
Farrukh
Luckily, after playing some sample code, I've got what I want. Its actually EnvDTE.WindowEvents.
In VS IDE, every Code Document is also a Window. And it has the Focus event: WindowActivated. Here is my delegate to subscribe for this event:
WinEvents.WindowActivated += new _dispWindowEvents_WindowActivatedEventHandler(WinEvents_WindowActivated);
void WinEvents_WindowActivated(Window GotFocus, Window LostFocus)
{
Debug.WriteLine("GotFocus: " + GotFocus.Caption );
//throw new NotImplementedException();
}
Best regards
Farrukh

Resources