April 20th, 2012
I spent some time today to find out, how to disconnect a network drive in Windows 7. Using NET USE command or the explorer function “Disconnect” resulted in message “This network connection does not exist”. One saw a network drive in explore, but it was red X-ed. Using gpedit.msc sloved my issue. The link below describes the solution:
http://forums.windowsforum.org/index.php?showtopic=46984
Posted in Delphi, General topics | No Comments »
March 12th, 2012
If set to false the hasDownArrow property of the FilteringSelect makes drop down arrow invisible. This can be useful in some situations. For example if you want to represent the data not as drop down list but as a tree. In this case you can set the drop down arrow to invisible, define your own button right to the FilteringSelect and show up a dialog with the tree representation if the user clicks on you custom button. Read the rest of this entry »
Posted in JavaScript, Web development | No Comments »
March 9th, 2012
dijit.Tree class in dojo does not contain a function to collapse all its nodes automatically. There is a function _collapseNode which collapses one node. We will use it to realize the recursive approach to collapse the whole tree. Important: don’t close the root element, otherwise your whole tree disappears!
function collapsTree(tree) {
// recursive function for collapsing the nodes
function collapseRec(node) {
// the root node should not be collapsed
if (tree.showRoot == false && tree.rootNode != node) {
tree._collapseNode(node);
}
// get only expandable children
var children= dojo.filter(node.getChildren() || [], function (node) {
return node.isExpandable;
});
// this is the magic! dojo waits till one node collapses
// before it processes the next node
dojo.map(children, collapse);
}
if(tree)
collapseRec(tree.rootNode);
}
Posted in JavaScript | No Comments »
February 29th, 2012
Detecting incoming and outgoing calls in Android can be realized in several ways. One of the possibilities is to use a custom PhoneStateListener which can be attached to the TelephonyManager in your onReceive() function of the custom BroadcastReceiver. This is a “clean” way, beacause the BoradcastReceiver object is destroyed as soon as the onReceive() function is left. But if you just want to do some little stuff, you can implement your logic directly in the onReceive() function. Here how it works. Read the rest of this entry »
Posted in Android | 1 Comment »
February 28th, 2012
To copy some text to a clipboard in Android is pretty simple.
private void CopyNumber(String someText, Context context) {
ClipboardManager clipMan = (ClipboardManager)context
.getSystemService(Context.CLIPBOARD_SERVICE);
clipMan.setText(phoneNumber);
}
context parameter is required if you want to use the function outside Activities
Posted in Android | No Comments »
February 22nd, 2012
Generally, DOJO does not support a direct refresh/update of the dijit.Tree. If you want to provide your dijit.Tree object by a new target URL and refresh your dijit.Tree, there are two possibilities. The first one is to destroy your tree object completely and build up your tree again with a new store (with new target URL). But its not that elegant. The better way is to extend your dijit.Tree class by the underlying function.
Read the rest of this entry »
Posted in JavaScript | No Comments »
November 1st, 2011
The function below uses ShellAPI and implements Open Folder Dialog. This function works fine on Windows XP and Windows7 as well.
Read the rest of this entry »
Posted in Delphi | No Comments »