Search Results

Search found 37 results on 2 pages for 'flyout'.

Page 1/2 | 1 2  | Next Page >

  • ie9/CSS: Flyout menu not working in ie9, but looks great in Firefox/Chrome

    - by Brandon
    Please see this flyout menu: http://www.caseen.com/store.html. It looks amazing in both Firefox and Chrome, but not in IE9! Trying to see what is going on =(. It looks like ie9 is completing ignoring the stylesheet, but in error checking and clicking ie9 direct mode, it shows up however VERY ugly with huge nasty white borders around the links! Please see my code: <div class="flyout"> <ul> <!--START: CATEGORIES--> <!--START: CATEGORY_FORMAT--> <li><a href="view_category.asp?cat=CATID">&nbsp;CATEGORY</a> <!--END: CATEGORY_FORMAT--> <ul><!--START: SUB_CATEGORY_FORMAT--> <li><a href="view_category.asp?cat=CATID">&nbsp;CATEGORY</a></li> <!--END: SUB_CATEGORY_FORMAT--></ul> <!--END: CATEGORIES--> </li> </ul> </div> AND CSS .flyout { width: 130px; height: auto; position:relative; margin: -10 0; padding: 0; z-index:10000; } .flyout ul li a { display:block; text-decoration:none; color: #fff; width: 130px; border: solid; border-color: #000; border-width: 0 0 0 5px; text-align:left; font-size:12px; line-height: 25px; } .flyout ul { padding:0px; list-style-type: none; } .flyout ul li { float:left; margin-right:1px; position:relative; } .flyout ul li ul { display: none; } .flyout ul li:hover a { border: solid; border-color: #fff; border-width: 0 2 0 5px; color: #60dfe5; } .flyout ul li:hover ul { display:block; position:absolute; top:0; left:130px; width:10px; } .flyout ul li:hover ul li a.hide { background:#000; color:#fff; } .flyout ul li:hover ul li:hover a.hide {width:180px;} .flyout ul li:hover ul li ul {display: none;} .flyout ul li:hover ul li a { display:block; background:#000; color:#60dfe5; width:200px; } .flyout ul li:hover ul li a:hover { background:#000; color:#fff; } Thanks, Brandon

    Read the article

  • Windows Sidebar gadget - cannont access a div in Flyout DOM

    - by cyrix86
    In the main gadget html, there is a div with an onclick that calls this method in the Gadget script file: ShowFlyout = function() { System.Gadget.Flyout.show = true; var flyoutDoc = System.Gadget.Flyout.document; var mainFlyoutDiv = flyoutDoc.getElementById('divFlyout'); mainFlyoutDiv.innerHTML = "hello"; } Here is the Flyout html: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>This is a flyout</title> <link href="Css\FlyoutStyle.css" type="text/css" rel="Stylesheet" /> </head> <body> <div id="divFlyout" > </div> </body> </html> The problem is that mainFlyoutDiv is always null. When peering into the System.Gadget.Flyout.document object through the debugger, the body parameter is null - I don't think that's right. The System.Gadget.Flyout.file value is being set elsewhere when the gadget first loads. What am I doing wrong? Also, does the System.Gadget.Flyout.show property have to be true before the System.Gadget.Flyout.document property can be accessed? My ultimate goal is to open a flyout and dynamically populate it's html

    Read the article

  • Gadget vista error var with flyout

    - by Jiinn
    hello ! i have a problem with a variable for the flyout : var friendsUser = ""; var friendsMdp = ""; System.Gadget.Settings.write("variableName", variableName); System.Gadget.settingsUI = "Settings.html"; System.Gadget.onSettingsClosed = SettingsClosed; System.Gadget.Flyout.visible = SettingsClosed; function SettingsClosed() { variableName = System.Gadget.Settings.read("variableName"); friendsUser = System.Gadget.Settings.read("friendUser"); friendsMdp = System.Gadget.Settings.read("friendMdp"); setContentText(); } function flyFriends() { System.Gadget.Flyout.file = 'friends.htm'; System.Gadget.Flyout.show = true ; var flyoutDiv = System.Gadget.Flyout.document.parentWindow; flyoutDiv.gMyVar = friendsUser; flyoutDiv.gMyVar2 = friendsMdp; } If i use this my flyout var is undefined , and if i write : var friendsUser = "test"; i have Test in var and after use setting i have nothing ... if i write var in flyoutDiv before System.Gadget.Flyout.show = true ; gadget bug . my settings dont have a problem, but the refresh of the var ... have you a idea ? thank you for all !

    Read the article

  • How to display a flyout menu on clicking an image in Grid header in MVC?

    - by Vincent
    A grid is displayed using the following code in MVC. <%= this.Grid( "routes-" + mc , "Testing", Model.Routes, new GridBuilder<RouteModel>() .Column( "chk", () => Html.Image( Url.Content( "down.gif" ), "Select or deselect tests" ), (m) => "<input type='hidden' name='routeLinkId' value='"+ m.RouteLinkID +"' />" + Html.CheckBox( "drugRoute" + mc + m.RouteLinkID, m.IsChecked ) ) .Column( "route clip-text", "Route", (m) = Html.Encode( m.Route ) ) .Column( "groups clip-text", "Groups", (m) = "" + Html.Encode(m.Group) + "" ) .ToGrid() ) % On clicking the image in header I need to display a flyout menu. The code for the flyout menu is below. <div id="group-menu-<%= mc %>" class="flyout-menu" title="Select tests"> <div> <p>Select</p> <ul> <li><button type="button" name="one">One</button></li> <li><button type="button" name="two">two</button></li> </ul> <p>Unselect</p> <ul> <li><button type="button" name="unselect-one">one</button></li> <li><button type="button" name="unselect-two">two</button></li> </ul> </div> </div> Now how do I display this menu on clicking the image in header.

    Read the article

  • Convert flyout menu to respond onclick vs mouseover

    - by Scott B
    The code below creates a nifty flyout menu action on a nested list item sequence. The client has called and wants the change the default behavior in which the flyouts are triggered by mouseover, so that you have to click to trigger a flyout. Ideally, I would just like to modify this code so that you click on a small icon (plus/minus) that sits to the right of the menu item if it has child menus. Can someone give me a bit of guidance on what bits I'd need to change to accomplish this? /* a few sniffs to circumvent known browser bugs */ var sUserAgent = navigator.userAgent.toLowerCase(); var isIE=document.all?true:false; var isNS4=document.layers?true:false; var isOp=(sUserAgent.indexOf('opera')!=-1)?true:false; var isMac=(sUserAgent.indexOf('mac')!=-1)?true:false; var isMoz=(sUserAgent.indexOf('mozilla/5')!=-1&&sUserAgent.indexOf('opera')==-1&&sUserAgent.indexOf('msie')==-1)?true:false; var isNS6=(sUserAgent.indexOf('netscape6')!=-1&&sUserAgent.indexOf('opera')==-1&&sUserAgent.indexOf('msie')==-1)?true:false; var dom=document.getElementById?true:false; /* sets time until menus disappear in milliseconds */ var iMenuTimeout=1500; var aMenus=new Array; var oMenuTimeout; var iMainMenusLength=0; /* the following boolean controls the z-index property if needed */ /* if is only necessary if you have multiple mainMenus in one file that are overlapping */ /* set bSetZIndeces to true (either here or in the HTML) and the main menus will have a z-index set in descending order so that preceding ones can overlap */ /* the integer iStartZIndexAt controls z-index of the first main menu */ var bSetZIndeces=true; var iStartZIndexAt=1000; var aMainMenus=new Array; /* load up the submenus */ function loadMenus(){ if(!dom)return; var aLists=document.getElementsByTagName('ul'); for(var i=0;i<aLists.length;i++){ if(aLists[i].className=='navMenu')aMenus[aMenus.length]=aLists[i]; } var aAnchors=document.getElementsByTagName('a'); var aItems = new Array; for(var i=0;i<aAnchors.length;i++){ // if(aAnchors[i].className=='navItem')aItems[aItems.length] = aAnchors[i]; aItems[aItems.length] = aAnchors[i]; } var sMenuId=null; var oParentMenu=null; var aAllElements=document.body.getElementsByTagName("*"); if(isIE)aAllElements=document.body.all; /* loop through navItem and navMenus and dynamically assign their IDs */ /* each relies on it's parent's ID being set before it */ for(var i=0;i<aAllElements.length;i++){ if(aAllElements[i].className.indexOf('x8menus')!=-1){ /* load up main menus collection */ if(bSetZIndeces)aMainMenus[aMainMenus.length]=aAllElements[i]; } // if(aAllElements[i].className=='navItem'){ if(aAllElements[i].tagName=='A'){ oParentMenu = aAllElements[i].parentNode.parentNode; if(!oParentMenu.childMenus) oParentMenu.childMenus = new Array; oParentMenu.childMenus[oParentMenu.childMenus.length]=aAllElements[i]; if(aAllElements[i].id==''){ if(oParentMenu.className=='x8menus'){ aAllElements[i].id='navItem_'+iMainMenusLength; //alert(aAllElements[i].id); iMainMenusLength++; }else{ aAllElements[i].id=oParentMenu.id.replace('Menu','Item')+'.'+oParentMenu.childMenus.length; } } } else if(aAllElements[i].className=='navMenu'){ oParentItem = aAllElements[i].parentNode.firstChild; aAllElements[i].id = oParentItem.id.replace('Item','Menu'); } } /* dynamically set z-indeces of main menus so they won't underlap */ for(var i=aMainMenus.length-1;i>=0;i--){ aMainMenus[i].style.zIndex=iStartZIndexAt-i; } /* set menu item properties */ for(var i=0;i<aItems.length;i++){ sMenuId=aItems[i].id; sMenuId='navMenu_'+sMenuId.substring(8,sMenuId.lastIndexOf('.')); /* assign event handlers */ /* eval() used here to avoid syntax errors for function literals in Netscape 3 */ eval('aItems[i].onmouseover=function(){modClass(true,this,"activeItem");window.clearTimeout(oMenuTimeout);showMenu("'+sMenuId+'");};'); eval('aItems[i].onmouseout=function(){modClass(false,this,"activeItem");window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout("hideMenu(\'all\')",iMenuTimeout);}'); eval('aItems[i].onfocus=function(){this.onmouseover();}'); eval('aItems[i].onblur=function(){this.onmouseout();}'); //aItems[i].addEventListener("keydown",function(){keyNav(this,event);},false); } var sCatId=0; var oItem; for(var i=0;i<aMenus.length;i++){ /* assign event handlers */ /* eval() used here to avoid syntax errors for function literals in Netscape 3 */ eval('aMenus[i].onmouseover=function(){window.clearTimeout(oMenuTimeout);}'); eval('aMenus[i].onmouseout=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout("hideMenu(\'all\')",iMenuTimeout);}'); sCatId=aMenus[i].id; sCatId=sCatId.substring(8,sCatId.length); oItem=document.getElementById('navItem_'+sCatId); if(oItem){ if(!isOp && !(isMac && isIE) && oItem.parentNode)modClass(true,oItem.parentNode,"hasSubMenu"); else modClass(true,oItem,"hasSubMenu"); /* assign event handlers */ eval('oItem.onmouseover=function(){window.clearTimeout(oMenuTimeout);showMenu("navMenu_'+sCatId+'");}'); eval('oItem.onmouseout=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout(\'hideMenu("navMenu_'+sCatId+'")\',iMenuTimeout);}'); eval('oItem.onfocus=function(){window.clearTimeout(oMenuTimeout);showMenu("navMenu_'+sCatId+'");}'); eval('oItem.onblur=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout(\'hideMenu("navMenu_'+sCatId+'")\',iMenuTimeout);}'); //oItem.addEventListener("keydown",function(){keyNav(this,event);},false); } } } /* this will append the loadMenus function to any previously assigned window.onload event */ /* if you reassign this onload event, you'll need to include this or execute it after all the menus are loaded */ function newOnload(){ if(typeof previousOnload=='function')previousOnload(); loadMenus(); } var previousOnload; if(window.onload!=null)previousOnload=window.onload; window.onload=newOnload; /* show menu and hide all others except ancestors of the current menu */ function showMenu(sWhich){ var oWhich=document.getElementById(sWhich); if(!oWhich){ hideMenu('all'); return; } var aRootMenus=new Array; aRootMenus[0]=sWhich var sCurrentRoot=sWhich; var bHasParentMenu=false; if(sCurrentRoot.indexOf('.')!=-1){ bHasParentMenu=true; } /* make array of this menu and ancestors so we know which to leave exposed */ /* ex. from ID string "navMenu_12.3.7.4", extracts menu levels ["12.3.7.4", "12.3.7", "12.3", "12"] */ while(bHasParentMenu){ if(sCurrentRoot.indexOf('.')==-1)bHasParentMenu=false; aRootMenus[aRootMenus.length]=sCurrentRoot; sCurrentRoot=sCurrentRoot.substring(0,sCurrentRoot.lastIndexOf('.')); } for(var i=0;i<aMenus.length;i++){ var bIsRoot=false; for(var j=0;j<aRootMenus.length;j++){ var oThisItem=document.getElementById(aMenus[i].id.replace('navMenu_','navItem_')); if(aMenus[i].id==aRootMenus[j])bIsRoot=true; } if(bIsRoot && oThisItem)modClass(true,oThisItem,'hasSubMenuActive'); else modClass(false,oThisItem,'hasSubMenuActive'); if(!bIsRoot && aMenus[i].id!=sWhich)modClass(false,aMenus[i],'showMenu'); } modClass(true,oWhich,'showMenu'); var oItem=document.getElementById(sWhich.replace('navMenu_','navItem_')); if(oItem)modClass(true,oItem,'hasSubMenuActive'); } function hideMenu(sWhich){ if(sWhich=='all'){ /* loop backwards b/c WinIE6 has a bug with hiding display of an element when it's parent is already hidden */ for(var i=aMenus.length-1;i>=0;i--){ var oThisItem=document.getElementById(aMenus[i].id.replace('navMenu_','navItem_')); if(oThisItem)modClass(false,oThisItem,'hasSubMenuActive'); modClass(false,aMenus[i],'showMenu'); } }else{ var oWhich=document.getElementById(sWhich); if(oWhich)modClass(false,oWhich,'showMenu'); var oThisItem=document.getElementById(sWhich.replace('navMenu_','navItem_')); if(oThisItem)modClass(false,oThisItem,'hasSubMenuActive'); } } /* add or remove element className */ function modClass(bAdd,oElement,sClassName){ if(bAdd){/* add class */ if(oElement.className.indexOf(sClassName)==-1)oElement.className+=' '+sClassName; }else{/* remove class */ if(oElement.className.indexOf(sClassName)!=-1){ if(oElement.className.indexOf(' '+sClassName)!=-1)oElement.className=oElement.className.replace(' '+sClassName,''); else oElement.className=oElement.className.replace(sClassName,''); } } return oElement.className; /* return new className */ } //document.body.addEventListener("keydown",function(){keyNav(event);},true); function setBubble(oEvent){ oEvent.bubbles = true; } function keyNav(oElement,oEvent){ alert(oEvent.keyCode); window.status=oEvent.keyCode; return false; }

    Read the article

  • jQuery CSS Custom Flyout Menu Styling Issue

    - by aherrick
    I'm close to nailing this flyout menu I have been working on, just have a couple of current pain points. I'm trying to get left/right padding on my submenu items, as you can see I am not quite there. Also when the first submenu is displayed, I want to create a bit of a gap between the first row of list items and the child. Below is my current code and a screen shot displaying what I want. Based on my current CSS, any thoughts on how to get this done in a clean way? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> function mainmenu() { $("#nav ul").css({ display: "none" }); // Opera Fix $("#nav li").hover(function() { $(this).find('ul:first').css({ visibility: "visible", display: "none" }).show(400); }, function() { $(this).find('ul:first').css({ visibility: "hidden" }); }); } $(document).ready(function() { mainmenu(); }); </script> <style type="text/css"> * { padding: 0px; margin: 0px; } body { font-size: 0.85em; font-family: Verdana, Arial, Helvetica, sans-serif; } #nav, #nav ul { margin: 0; padding: 0; list-style-type: none; list-style-position: outside; position: relative; } #nav a { display: block; padding: 4px 0px 4px 0px; color: #dfca90; text-decoration: none; background-color: #ECE9D8; font-size: 9px; font-weight: bold; font: bold 15px Palatino, 'Palatino Linotype' , Georgia, serif; } #nav > li > a { font-size: 16px; font-variant: small-caps; border-right: 1px solid #dfca90; padding-right: 10px; padding-left: 10px; padding-bottom: 6px; padding-top: 6px; background-color: #fff; color: #dfca90; } #nav li ul li a:hover { color: #999; } #nav li { float: left; position: relative; } #nav ul { position: absolute; display: none; width: 170px; border: 2px solid #dfca90; } #nav ul li { } #nav li ul a { width: 170px; height: auto; float: left; } #nav ul ul { top: -2px; } #nav li ul ul { left: 170px; background-color: #ECE9D8; } #nav li:hover ul ul, #nav li:hover ul ul ul, #nav li:hover ul ul ul ul { display: none; } #nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li li li li:hover ul { display: block; } </style> </head> <body> <ul id="nav"> <li><a href="#">1 HTML</a></li> <li><a href="#">2 CSS</a></li> <li><a href="#">3 Javascript </a> <ul> <li><a href="#">3.1 jQuery</a> <ul> <li><a href="#">3.1.1 Download</a> </li> <li><a href="#">3.1.2 Tutorial</a> </li> </ul> </li> <li><a href="#">3.2 Mootools</a></li> <li><a href="#">3.3 Prototype</a></li> </ul> </li> </ul> </body> </html>

    Read the article

  • Closing a window when it's "no longer needed".

    - by Mason Blier
    This is kind of a hard question to describe, and I've searched for about an hour now to no avail. Essentially, picture a small 'flyout' window like the Windows 7 Wireless Control or the Volume Slider from the system tray(notification area). When you click on the icon, the application pops up with focus, and if you click off of it, the window destroys itself. I thought it woudl be easily solved by simply having my window destroy it self when it loses focus (I've been listening for WM_KILLFOCUS), but the problem is, if the icon is clicked, my window does not always get focus. Since this isn't the case, if the user clicks my icon, and then clicks away because it was a mistake (on the desktop say), then how can I set my app to close? I've tried messing with SPY++ but checking the volume control / wireless control apps are proving difficult as they disappear when I try to get their window/process handles. Thanks!

    Read the article

  • The gestures of Windows 8 (Consumer preview): part 2, More about Search

    - by Laurent Bugnion
    This is part 2 of a multipart blog post about the gestures and shortcuts in Windows 8 consumer preview. Part 1 can be found here! More about the Search charm In the first installment of this series, we talked about the charms and mentioned a few gestures to display the Search charm. Search is a very central and powerful feature in Windows 8, and allows you to search in Apps, Settings, Files and within Metro applications that support the Search contract. There are a few cool features around the Search, and especially the applications associated to it. I already mentioned the keyboard shortcuts you can use: Win-C shows the Charms bar (same as swiping from the right bevel towards the center of the screen). Win-Q open the Search fly out with Apps preselected. Win-W open the Search fly out with Settings preselected. Win-F open the Search fly out with Files preselected. Searching in Metro apps In addition to these three search domains, you can also search a Metro app, as long as it supports the Search contract (check this Build video to learn more about the Search contract). These apps show up in the Search flyout as shown here: Notice the list of apps below the Files button? That’s what we are talking about. First of all, the list order changes when you search in some applications. For instance, in the image above, I had used the Store with the Search charm. This is why the store shows up as the first app. I am not 100% what algorithm is used here (sorting according to number of searches is my guess), but try it out and try to figure it out Applications that have never been searched are sorted alphabetically. Does it mean we will see cool app names like ___AAA_MyCoolApp? I certainly hope not!! Pinning You can also pin often used apps to the Search flyout. To pin an app with the mouse, right click on it in the Search flyout and select Pin from the context menu. With the keyboard, use the arrow keys to go down to the selected app, and then open the context menu. With the finger, simply tap and hold until you see a semi transparent rectangle indicating that the context menu will be shown, then release. The context menu opens up and you can select Pin. Pin context menu Pinned apps Unpinning, Hiding Using the same technique as for pinning here above, you can also unpin a pinned application. Finally, you can also choose to hide an app from the Search flyout altogether. This is a convenient way to clean up and make it easy to find stuff. Note: At this point, I am not sure how to re-add a hidden app to the Search flyout. If anyone knows, please mention it in the comments, thanks! Reordering You can also reorder pinned apps. To do this, with the finger, tap, hold and pull the app to the side, then pull it vertically to reorder it. You can also reorder with the mouse, simply by clicking on an app and pulling it vertically to the place you want to put it. I don’t think there is a way to do that with the keyboard though. That’s it for now More gestures will follow in a next installment! Have fun with Windows 8   Laurent Bugnion (GalaSoft) Subscribe | Twitter | Facebook | Flickr | LinkedIn

    Read the article

  • Our New Website Header (& Other Tweaks)

    - by justin.kestelyn
    Last week, the Oracle Technology Network Website went fixed-width. There are several reasons for this, most relating to providing a consistent user experience, easier management of Website content, etc. Furthermore, it's fairly standard for developer portals these days - java.sun.com, MSDN, and IBM DeveloperWorks are also all fixed-width sites. (My apologies to everyone who is unhappy about this change, but it really is an overall positive one.) Today, we have rolled out a brand-new header, the first step in what we call the "Mosaic" project - which is an effort to make the user experience across all Oracle Websites more consistent. To summarize the impact: The "pull-down" menus on the OTN site disappear; most of them move into a "flyout" button in the header. You can access the OTN flyout from any page on Oracle.com or the OTN site. Great for our page views. :) You also have direct access to the Downloads index from anywhere on Oracle.com. If you so desire, you can directly access product overviews, Oracle University and Support info, Oracle Store, etc etc from the OTN site now. Due to limited space in the flyout we cannot accommodate *all* the pull-down items, but they are all no more than 1 or 2 clicks away. This approach has been validated in extensive user testing over the last few months; I welcome your feedback now in comments. There are many other changes in train, with the next one being: A major homepage redesign, the first in 4 or 5 years.

    Read the article

  • Copy & rename file using .bat file language?

    - by flyout
    I want to make a .bat to copy & rename a file multiple times. I want to have a list of names, and an original file, then I want to copy that file and rename it for each name on the list. How I can do this using a .bat file? Also is it possible to run winrar fromthe .bat to .rar or .zip every file after copying/renaming?

    Read the article

  • Disable script debugging in IWebBrowser2 OLE control? C++

    - by flyout
    I have a IWebBrowser2 I use to visit some webpages with .Navigate() When the page has a js error I got a warning box for "Syntax error", so I used .put_Silent(TRUE). And now I get a warning for "VS Just-In-Time Debugger: Unhandled exception" instead How can I disable all the script error warnings (including JIT debugger) from my code (i mean without modifying the real IE settings)?

    Read the article

  • How to fill byte array with junk?

    - by flyout
    I am using this: byte[] buffer = new byte[10240]; As I understand this initialize the buffer array of 10kb filled with 0s. Whats the fastest way to fill this array (or initialize it) with junk data every time? I need to use that array like 5000 times and fill it every time with different junk data, that's why I am looking for a fast method to do it. The array size will also have to change every time.

    Read the article

  • Why this base64 function stop working when increasing max length?

    - by flyout
    I am using this class to encode/decode text to base64. It works fine with MAX_LEN up to 512 but if I increase it to 1024 the decode function returns and empty var. This is the function: char* Base64::encode(char *src) { char* ptr = dst+0; unsigned triad; unsigned int d_len = MAX_LEN; memset(dst,'\0', MAX_LEN); unsigned s_len = strlen(src); for (triad = 0; triad < s_len; triad += 3) { unsigned long int sr = 0; unsigned byte; for (byte = 0; (byte<3)&&(triad+byte<s_len); ++byte) { sr <<= 8; sr |= (*(src+triad+byte) & 0xff); } sr <<= (6-((8*byte)%6))%6; // shift left to next 6bit alignment if (d_len < 4) return NULL; // error - dest too short *(ptr+0) = *(ptr+1) = *(ptr+2) = *(ptr+3) = '='; switch(byte) { case 3: *(ptr+3) = base64[sr&0x3f]; sr >>= 6; case 2: *(ptr+2) = base64[sr&0x3f]; sr >>= 6; case 1: *(ptr+1) = base64[sr&0x3f]; sr >>= 6; *(ptr+0) = base64[sr&0x3f]; } ptr += 4; d_len -= 4; } return dst; } Why could be causing this?

    Read the article

  • How to fill byte array with junk? C#

    - by flyout
    I am using this: byte[] buffer = new byte[10240]; As I understand this initialize the buffer array of 10kb filled with 0s. Whats the fastest way to fill this array (or initialize it) with junk data everytime? I need to use that array like 5000 times and fill it everytime with different junk data, thats why I am looking for a fast method to do it. The array size will also have to change everytime.

    Read the article

  • Application settings methods? c++

    - by flyout
    I am thinking about adding configurable settings to an application, and I think the easiest ways are an external file or win registry (its a win only app). Which way would be better? I was wondering, an user with not enough permissions may not be able to create/write the config file. And in the case of the registry, would todays antivirus allow me to add/edit/remove keys? Or they only monitor certain keys? Also, if someone knows a class/lib to manage config settings (in pure win32) in vc++ please post it.

    Read the article

  • How can I change the value or a static char* from a function? C++

    - by flyout
    I am trying to change the value of a "static char *" I define at startup, I do it from inside a function, and when this function returns the var I am trying to re-set the value doesn't retain it. Example: static char *X = "test_1"; void testFunc() { char buf[256]; // fill buf with stuff... X = buf; } How can I achieve this without using static for buf? Should I use another datatype? if so, which one?

    Read the article

  • Can I use #undef this way?

    - by flyout
    I want to get some settings I store in the registry, and if they differ from a #define I want to redefine it, could I do it this way?: #define DEFINED_X "testSetting" void LoadConfig() { regConfigX = some value previusly stored in the registry; if(regConfigX!=DEFINED_X) { #undef DEFINED_X #define DEFINED_X regConfigX } } I tought #define was used only when compiling, would this code work when running the compiled exe?

    Read the article

  • Can I use a static var to "cache" the result? C++

    - by flyout
    I am using a function that returns a char*, and right now I am getting the compiler warning "returning address of local variable or temporary", so I guess I will have to use a static var for the return, my question is can I make something like if(var already set) return var else do function and return var? This is my function: char * GetUID() { TCHAR buf[20]; StringCchPrintf(buf, 20*sizeof(char), TEXT("%s"), someFunction()); return buf; } And this is what I want to do: char * GetUID() { static TCHAR buf[20]; if(strlen(buf)!=0) return buf; StringCchPrintf(buf, 20*sizeof(char), TEXT("%s"), someFunction()); return buf; } Is this a well use of static vars? And should I use ZeroMemory(&buf, 20*sizeof(char))? I removed it because if I use it above the if(strlen...) my TCHAR length is never 0, should I use it below?

    Read the article

  • How to change executable icon from c# code? (not my app icon)

    - by flyout
    How can I change *.EXEs icons from c# code (not my main app icon but from that app i want to change the icon of another exe). I eventually would have to change the icons for A LOT of files so I am looking for a fast and good performance way to do it. I have been googling for 30min but all I found is how to set the icon for the app in VS.

    Read the article

  • Buffer size: N*sizeof(type) or sizeof(var)? C++

    - by flyout
    I am just starting with cpp and I've been following different examples to learn from them, and I see that buffer size is set in different ways, for example: char buffer[255]; StringCchPrintf(buffer, sizeof(buffer), TEXT("%s"), X); VS char buffer[255]; StringCchPrintf(buffer, 255*sizeof(char), TEXT("%s"), X); Which one is the correct way to use it? I've seen this in other functions like InternetReadFile, ZeroMemory and MultiByteToWideChar.

    Read the article

  • Changing the direction of a Combo box dropdown in SWT

    - by Kris
    Hi, I'm building an Eclipse plugin in SWT, and I have the following problem: one of my fields is a combo box, and in some cases it may have fairly long items as selection options. My plugin runs on the right side of the screen, so when you go to use the combo-box, the right side of the combo box is cut off. So, my question is: is there any way to change the dropdown's alignment relative to the combo control? It seems to be permanently left-aligned... and I'm pretty sure you can change the direction in Swing (though the only place I've seen it done is in the Substance UI demo. The Combo Box tab has boxes with North, South East, and West flyout directions... for my application, I need something like the West flyout) Note: Setting actual text limits is a last-case-scenario option; it would be quite a bit of guesswork to set the text limit dynamically (since the widget's view can be resized). Here's a picture (sorry, I can only have one link and no images :( ... I need some more rep :p) Left side of the line: Proper width - the view is the wide enough for the combo dropdown to display all the text; you can see the scrollbars on the right side. Right side of the line: Too small - Here, the view has been resized, and the combo dropdown scrollbar (as well as some of the text) is cut off by the right side of the screen. I always have more screen space available to the left (since this is always on the right hand side of the screen), but the combo dropdown always appears to the lower right. Hopefully this is clear enough.

    Read the article

  • New Oracle.com global navigation

    - by tim.bonnemann
    This is a guest post by Michal Kopec, Senior User Experience Architect her at Oracle Marketing Brand and Creative. We have just refreshed the Oracle.com global navigation to serve you better with Oracle related information and news. Highlights 1. Updated, user-oriented and business information balanced navigational categories. Say hello to the new categories: Downloads, Education and Oracle Technology Network. Oracle Partner Network navigation received a facelift too. 2. Brand new flyout based navigation - mouse over Partners for instance - providing both a high level content overview as well as shortcut links for most popular website destinations 3. Introducing audience based - I'm a... - and - I want to... - task-based navigation. Now you can navigate based on who you are or what is you want to accomplish. Please note this is an initial step - we want to build out those based on your opinions and feedback. 4. Adjusted Oracle Technology Network horizontal navigation to match Oracle.com. Oracle Technology Network users can now benefit from OTN content being accessible from anywhere during their Oracle.com and OTN visits of course :) 5. Last but not least - we applied the same refreshed global navigation to a couple of country sites - starting with Oracle Brazil and Oracle China. More to come. The project internal code name is Mosaic. It is an effort to provide you with unified user and brand experience during your Oracle websites visit. Every time you hear Mosaic expect great things to happen. With that - please let us know what you think. We value your opinion.

    Read the article

1 2  | Next Page >