Extjs 4.2.1 - Draggable/Undraggable windows on the fly - window

In my application, I have 4 windows on the screen and all the windows are draggable.
My need is that, all the windows should be made draggable/undraggable on a click of a button(toggle).
I set draggable true/false on the fly. But, the property is not updated. I even closed and opened the window once the draggable property is changed. But, ended in vain.
Any help is appreciated.
I think, I need doLayout() kind of thing to update the change.

Try enable and disable methods on window.dd object:
w.dd.disable(); // disables d&d
w.dd.enable(); // enables d&d
Sample: http://jsfiddle.net/cb7rtcya/1/ (It's written in Ext JS 5, but should work also on 4)

Related

Vaadin ckEditor addon has two panels

No matter what I do when I run the latest version of ckEditor I have two panels on my screen. Both are populated with data. Although you can only see one editor in full on the screenshot if I increase the height you can see both editors. I've brought the code down to the bare minimum. It use to work but in the latest version I always have two editors no matter what I do, and no matter what browser I use.
Also when I call getValue() on the editor it always brings back the value of the bottom editor. I've confirmed this by putting different values in the different editors.
My code is:
protected void init(VaadinRequest request) {
{
CKEditorTextField ckEditorTextField = new CKEditorTextField();
ckEditorTextField.setValue("hello world");
ckEditorTextField.setHeight("500px");
ckEditorTextField.setWidth("500px");
setContent(ckEditorTextField);
}
And yes I know I should use CKEditorConfig but I've tried to minimize all code to the bare minimum. I've also tried with layouts and it makes no difference. The reason I put the height and width is to make it more visible, but it's not required. Also this code is called on the main UI class.
The issue was that an upgrade to Vaadin hadn't properly taken, there were still some caching issues. The way to resolve it can be found here: https://vaadin.com/forum/#!/thread/2963857/2963856
The steps are:
Ivy-> Clean all caches
Ivy -> Resolve
Reboot Eclipse
Compile Vaadin widgets

How to change the title/caption of MFC SDI documentless application

I can't find a working solution to change the title of my MFC SDI application. I don't use document/view. I need to change the title according to internal state of the applicaiton.
I've tried CMainFrame::SetWindowText from my main app module in InitInstance - with no luck.
I've tried to change CMainFrame::m_strTitle member variable and call OnUpdateFrameTitle(TRUE) after that - still no luck.
Inside OnTimer procedure - calling AfxGetMainWnd()->SetWindowText(_T("title from OnTimer")); - it does not work either.
What am I missing? That should be a common and simple task, shouldn't it?
EDIT: I'm sorry, it seems SetWindowText is working, just need to properly compile my app.
That's all my fault.
Overwrite CMainFrame::PreCreateWindow.
Clear the style FWS_ADDTOTITLE
cs.style &= ~(LONG)FWS_ADDTOTITLE;
Now it should be possible the window caption in any way you like.
The Default window caption is taken from the string resource with the ID AFX_IDS_APP_TITLE.

slow scrolling when using responsive bootstrap theme

I am using a bootstrap 3 template and have noticed on some that scrolling is not smooth and kind of bumpy. I am not even sure what to look for. This only happens in Chrome. It does NOT happen in Safari or Firefox.
Is this a javascript or css problem? I have never run across this before.
This seems to happen worse in Chrome for mac, but also happens in chrome for windows.
It seems to happen when I make the window smaller and then make it bigger again. If I leave the window the same size, it seems to scroll fine.
Link:
http://demo.phppointofsalestaging.com --> Click Sales then resize the window in Chrome and then scroll down and then up. You will notice it is very bumpy and not smooth
:root { scroll-behavior: auto; }
Add this simple code to your custom CSS file.
"scroll-behavior" declared as "smooth" in bootstrap css/bootstrap.reboot.css.
So we need to overwrite it using our custom css.
The problem is in the jquery.nicescroll plugin that is used with the theme, the function jQuery.fn.scrollTop make the problem, it takes more than 75% from the cpu when run. my solution is :
You are using the jquery.nicescroll plugin version 3.4.0 use the latest version currently version 3.5.0 available.
If not working as expected, downgrade to version 3.2.0 I'm using it with my site without any problem.
Also check that if the hwacceleration in the Configuration parameters of the plugin is set to (default: true).
Update 1:
nicescroll plugin is a solution to have a custom scrollbars compatible with desktop, tablet and phone devices and to override the default scrollbars of the browser " more information her ", "you didn't see the diffrence because the plugin used in your project works when your browser window under 767px" so another solution if you don't need it you can remove the plugin from your files by following this steps:
Delete the plugin file (jquery.nicescroll.js) from your script folder.
Delete the plugin link from all your files.
Delete the plugin function lines (21 to 36), (49 to 66), (149) from (unicorn.js) file.
Update 2:
I made some tweaks for the (unicorn.js), download it from her, then replace your original one.
Hope this will help you.

Monodroid Custom UI controls

I want to know where I can get access to the NinePatch images specifically for Monodroid. I want to change the default coloring from blue to orange (if I was doing this in Java it would already be orange).
All I need is to change an edittext so that it's default colors are different. I have seen
http://www.androidworks.com/changing-the-android-edittext-ui-widget
which is really helpful but only as far as vanilla Android is concerned. I tried following the instructions, but I found the standard orange java images, not the Mono ones, which are blue.
Minimum framework is 2.2. I know that I am getting the java images because when I go to C:\Android\android-sdk\platforms there is no android-2.2 folder.
I'm not really sure what you are referring to. Mono for Android does not ship any NinePatch images. Mono for Android simply provides a thin binding over the Java API, it does not do anything custom.
Maybe it is triggered by changing your Android target framework?
I found my answer - and thank goodnesss it did not involve changing the 9Patches!
You can make an xml in the drawable folder which describes your button, textbox, etc. and make a selector with a solid tag, pressed event, etc. (http://developer.android.com/guide/topics/resources/drawable-resource.html)
Then you can set up the colors as a constant set in the Values folder and boom! Solution!

Extension Development: Frozen Firefox scrollbar and dis-functional hot-keys

I am writing a Firefox extension which creates a Java applet in the page.
function addApplet(aDocument,url,classfile,archive) {
if (navigator.javaEnabled()) {
var anApplet,body;
body = aDocument.getElementsByTagName('body')[0];
anApplet = aDocument.createElement('applet');
anApplet.setAttribute('CODEBASE',url);
anApplet.setAttribute('code',classfile);
anApplet.setAttribute('archive',archive);
anApplet.setAttribute('name',"Applet");
anApplet.setAttribute('width',"0");
anApplet.setAttribute('height',"0");
body.appendChild(anApplet);
}
}
The JAR file loaded from the applet is 500KB in size. I noticed that sometimes the extension causes Firefox's vertical scrollbar to freeze and the hot-keys to stop working. The scroll-bar and hot-keys work fine if I prevent the extension to append the applet to the page.
Another weird behavior is -- on the frozen page if I click inside any text/search box or even address bar the scroller and the hotkeys begin to work again. The same thing happens if I switch tabs or minimize the browser window.
I am using Firefox 3.6.12 on WindowsXP.
Please help me if you have an idea regarding this or if I should provide more information.
(Hey guys this problem is still not solved....please help me out with this......)
Thanks
See if something similar happens if you load the applet from an html page that includes the tag and its children as static content, rather than content added to the DOM.
I imagine it's a problem of Firefox and java, not your code.
Applets can be tricky. I would suggest creating a page of pure HTML that works, first.
As far as suggestions for change go, 1st thing to change is the width/height of the applet. An applet with 0 size can cause all sorts of problems. Instead, give it a WxH of 20 (then later hide it using CSS).
Ok this has worked:
Solution:
This behavior is the default since JDK 1.3. However you might need to prevent the applet from getting focus on startup, for example, if your applet is invisible and does not require focus at all. In this case, you can set to false the special parameter initial_focus in the HTML tag, as follows:
<applet code="MyApplet" width=50 height=50>
*<param name=initial_focus value="false">*</applet>
Cheers,

Resources