CodeMirror: external search dialog - codemirror

I am building a small service based on CodeMirror where I would like to have the search box appear as a div rather than a popup as in the CodeMirror example. Further I would like to initiate the "search next" and "search previous" functions through clicks as well as via keyboard.
I am not sure how to do this, could somebody help me please?

You can define your own CodeMirror.prototype.openDialog method that shows the dialog the way you want (just conform to the interface). And you can run editor.execCommand("findNext") (or "findPrev") from a button's click handler to search next/previous.

Related

Save and Continue option while editing forms in MediaWiki

I have created a form using the "Create Form" option in MediaWiki with few text areas to fill in by the user. I wanted to enable the option of save and continue wherein a user can save the form after filling it partially, and then continue adding/editing the information.
I used the Extension:Checkpoint to fulfill the same. The extension provides the option when creating/editing a normal page in mediawiki, but not when
Adding new information in a form or
editing old form using "Edit with Form" option
Searched a lot on ways to be able to use the same, but failed. Also tried using the standard input tag: save and continue, but it just creates text, and no button.
Is there a way to get the functionality to work (did I miss something), or implement it in another way?
Thanks in advance.
The Save and Continue option as a matter of fact can be easily implemented without the use of the Extension:Checkpoint.
The standart input tag is defined within mediawiki which provides the user to provide different input options at the end of a page or a form.
The following different tag values are allowed:
"save" (for the "Save page" button)
"preview" (for the "Show preview" button)
"save and continue" (for the "Save and continue" button - this lets users
save the page without leaving the form)
"changes" (for the "Show changes" button)
"summary" (for the "Summary" text field)
"minor edit" (for the "This is a minor edit" checkbox)
"watch" (for the "Watch this page" checkbox)
"cancel" (for the "Cancel" link)
"run query" (for the "Run query" button in query forms)
The save and continue option can be easily used as follows:
{{{standard input|save and continue}}}
at the end of the page where you want the option.
It works as follows:
the button is not activated (appears as normal text) unless you type or change something in the form or page. As soon as you make even a slight change, the button is activated, to function just as every other button.
hence it might look as if the tag didn't work when it actually does. :)
PS: I still can't understand why the extension doesn't work on forms when it was designed keeping in mind the option of 'editing forms'.

GWT eventhandler specifics

I am making a simple webui in gwt and I want to implement the following functionality: once the user clicks a checkbox, a new text area with some wording appears. When the user unchecks the textbox, the textarea disappears. Can anyone show me the implementation on how to do this?
The CheckBox has a ValueChangeHander < Boolean >. You can use this to get the actual value, after the change.
There is also an example to get the value within the clickhandler.
http://www.gwtproject.org/javadoc/latest/com/google/gwt/event/logical/shared/HasValueChangeHandlers.html

Accessing forms created through LWUIT resource editor using code

I am trying to develop a quiz application using LWUIT resource editor and am having great difficulty.
I have created two Forms 'GUI1' and 'GUI2' .
GUI1 displays the following:
A question(in the form of a TextField)
5 RadioButtons belonging to the same group
A Button which says 'OK'
GUI2 displays the following:
A TextField
A Button to go back to GUI1
Now the problem is:
Initially GUI1 is displayed. When the user chooses a RadioButton , I wish to know which RadioButton was selected. If that RadioButton was indeed the correct answer, then when the user clicks on the 'OK' Button on GUI1, I wish to display the text 'correct' in the TextField on GUI2 and then display the GUI2.
If the user chose the wrong answer, then I wish to display the text "Wrong" in the TextField on GUI2 and then display the GUI2.
How can this be done with resource editor? I am very foxed. Please help.
I wish to refer to the TextField on GUI2 when I am currently on GUI1. How can this be done with resource editor? Writing a manual code for all this would be very time consuming.
Ok I will try to explain the best I can.
When you design the first Form GUI1 the five RadioButtons must be in the same group. I don't know how to do that in the resource editor (I think there is a field called ButtonGroup in the RadioButton, but I can't remeber). What I would do is take the five RadioButton by code in the before method of GUI1 and add them to a ButtonGroup element.
With ButtonGroup you can know which element is selected using ButtonGroup.setSelectedIndex(). When you press the Button take this value and act as appropriate to the situation.
If you don't understand anything please tell me and I will try to help you.
Is not a hard thing to do. There must be a way to do it with the Resoruce editor but at the moment I donĀ“t know how.
As Shai mentioned, the best thing to do is to use listeners to set the "state" of the buttons on clicking them and when you move to the next form you just retrieve the state of the previous text field.
Manual code may actually be faster for you, do most of the UI in the resource editor and transfer to a form that is written manually. That way you have full control over your objects and transfer back into the GUI builder form when needed.

GWT-Google web Toolkit-DialogBox

I have doubt regarding GWT .In Gwt if i click one button than it shows one dialog box at th same time the form outside the dialog box disabled.What component can be used for this task?
Thanks in advance
So, you want to open a popup dialog box, and at the same time disable the rest of the page until the user closes the dialog box?
If so, you can simply use gwt's DialogBox.
Use the constructor with the autohide flag set to false, and the box will not close until the user responds, thus disabling the rest of the page. If you want to make this even more clear, use the glass effect:
yourBox.setGlassEnabled(true);
You can also use the PopupPanel directly and build your own custom dialog box.
Now, if I got it wrong and you want to disable the form so it remains disabled after the popup, just disable it in the onClick handler of the button that opens the box.

MS Access 2003 - Simple value input into a text box from clicking label boxes

Ok so could anyone please help me out with the VB for auto entering information into a text box, by clicking certian label boxes on a form in access 2003.
I built this thing using label boxes as "sort of links" instead of button for navigation/commands etc, and I have this power point presentation viewer on one of the forms.
The client has numerous briefings and this will be great for me to provide a little something for them to be able to get their briefings from one spot.
So if I list the choices for the month out on the form as label boxes (with little mouse move events to resemble a web link) and they click on it to select, then the only way I know how this may become functional is if I add a text box to the form, and make it not visible, that way I can name it, and add it to the file path string and it works.
But how do I create the action of clicking the "link" result in "NVOWEFDJHF" into text box?
Anyone know a better way?
Yeah I am an amateur, so I am ALWAYS willing to learn a better way.
Thanks very much!
I would recommend using a transparent button instead of a label.
The main reason is that you can set the mouse cursor to become a small hand when you hover over the button, so it gives back information to the user that this can be clicked.
With a label, the user cannot make the difference between a normal label and one that can be clicked since there is no visual cue.
To create a button that resemble a label:
Add the button to the form
In the properties for the button, set the following:
Format > Back-Style: Transparent
Other > Cursor on Hover: Hyperlink Hand
Other > Name: btAutoFill (or whatever name you want)
If you want the button to resemble a link a bit more, you can change it's caption's format, making it blue and underlined if you wish.
Now if you view the form, you will see that the mouse cursor will change when you move over the 'button label'.
To automatically fill-in other controls when you click your button, add the code to handle its OnClick event (in the button's properties, under Events > On Click, choose [Event Procedure]):
Public Sub btAutoFill_Click()
myTextBox = "NVOWEFDJHF"
End Sub
Quick air code here...
Private Sub MyLabel_OnClick()
Me.MyTextBox = "NVOWEGDJHF"
End Sub
Don't forget your error handling.
You're making this as difficult as possible by using an approach that is not Access-native. The simplest way to make the labels "clickable" is to put a transparent command button over them. But that means the MouseMove events will go to the command button, so you'll have to have its events do the MouseOver actions.