Dialog boxes and file download
I need to make a program(open dialog box) that will choose a file and return the filename that it chooses. And i also need a program that will download a txt file from a pc to my own pc. I need help
i am new to java, ive just recently download j2sdk but i have trouble doing some codes coz its my first time. Please help. thanks in advance.
Try this code in the action performed section of a browse for file button of ur dialog ..
public void actionPerformed(ActionEvent e)
Object obj=e.getSource();
if(obj == browseButton)
{ FileDialog fd= new FileDialog(new Frame(), "Choose File");
fd.setVisible(true);
String fullPath =fd.getDirectory() +fd.getFile();
textField1.setText(fullPath);
About the second qusetion u need not download file from ur machine to your own machine unless for testing..
So for ur purpose i think u can just open the file using the code ..
import java.io.*;
public class temp{
public static void main(String args[]) throws Exception
String in="C:\\dir1\\inputfile.txt";
String out="C:\\dir2\\outputfile.txt";
File fileFrom = new File(in);
File fileTo = new File(out);
FileInputStream fin = new FileInputStream(fileFrom);
FileOutputStream fout= new FileOutputStream(fileTo);
long len = fileFrom.length();
byte[] temp= new byte[(int)len];
int x;
fin.read(temp);
fout.write(temp);
fin.close();
fout.close();
hope u will be able to solve ur prob.
Have a great time..
Similar Messages
-
Blank page shown instead of Open/Save As dialog box-CSV file download in IE
I am migrating an application hosted earlier on Oracle 9iAS (9.0.3.1 BP1) to OracleAS 10g (10.1.3) with Struts 1.2.9. While the below JSP code worked for the earlier s/w stack when accessed using IE 5.5 SP2 or above, a blank page is displayed with the new s/w stack. What I mean by "worked earlier" is this. A "Open/Save As" dialog box would appear. Trying to "Open" would open a new IE window launching MS Excel and displaying correct data. Trying to "Save As" would display correct filename and extension in the dialog box.
<%@page autoFlush="false" contentType="application/x-filler"%>
<%
try
String fileName = "ABC.CSV";
String strData = "A,B,C";
response.setContentLength(strData.length());
response.setHeader("Content-Type","application/octet-stream");
response.setHeader("Content-Disposition","inline;filename="+fileName);
ServletOutputStream ouputStream = response.getOutputStream();
ouputStream.write(strData.getBytes(), 0, strData.getBytes().length);
ouputStream.flush();
ouputStream.close();
catch(Exception e)
%>
I tried some changes listed below:
1. Deliberately introduced compilation errors in the JSP code.
2. Changed contentType="application/x-filler" to various MIME types like application/x-download, application/vnd.ms-excel, removing it altogether.
3. Commented out response.setHeader("Content-Type","application/octet-stream") and also tried other MIME types related to CSV/Excel.
4. Changed Content-Disposition from inline to attachment.
Each of the above resulted in an unacceptable behaviour compared with the earlier state:
1. Blank page shown as if nothing was happening even in case of deliberate incorrect JSP syntax.
2. Dialog box did show up with some combinations. But on trying to "Open" or "Save As", the dialog box shows up a second time. Then while trying to "Open", the contents get opened either inline or in MS Excel but with some additional garbage data like source file name.jsp etc. While trying to "Save As" the file name and extension take on the pattern <URL_Pattern>.htm where URL_Pattern would be "DOWNLOAD_ACTION.do".
Some other information:
1. This code works when accessed from desktop local container (Win 2000) but not when deployed on Unix env (HP-UX B.11.11.0109).
2. Latest patchsets are installed for IE.
3. The existing application is designed to work for ONLY IE 5.5 SP2 or above, so I haven't tried with other browsers. I have tried both IE 5.5 SP2 and 6.0 SP1.
Any help in this regard will be highly appreciated.
Thanks a lot for your valuable time..I have made it to work with the below changes:
1. Changed the URL pattern for <filter-mapping> for *.jsp to /*.jsp
2. Added <dispatcher>REQUEST</dispatcher> and <dispatcher>FORWARD</dispatcher>
3. Everything else (code-wise) is as before.
Because of these changes, the filter, wherein some headers are being added to the response, is being invoked appropriately now.
Thanks for you time and suggestion though... -
How to skip(do not wnat to get display) save dialogue box for file download
I am having servlet for downlading a file from server. When I call this servelt I am able to get the file from server but I get a save dialog box which I do not want. I want that this file should be stored at a specific location given by me in a servlet.
So haoe I can avoid that save dialog box and where I should specify the specific location?
Thanks in advance
package com.txcs.sms.server.servlet;
import java.io.*;
import java.util.zip.GZIPOutputStream;
import javax.servlet.*;
import javax.servlet.http.*;
public class DownloadServlet extends HttpServlet
public DownloadServlet()
separator = "/";
root = ".";
public void init(ServletConfig servletconfig)
throws ServletException
super.init(servletconfig);
context = servletconfig.getServletContext();
String s;
if((s = getInitParameter("dir")) == null)
s = root;
separator = System.getProperty("file.separator");
if(!s.endsWith(separator) && !s.endsWith("/"))
s = s + separator;
root = s;
public void doGet(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
throws ServletException, IOException
doPost(httpservletrequest, httpservletresponse);
public void doPost(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
throws ServletException, IOException
Object obj = null;
String s = "";
s = HttpUtils.getRequestURL(httpservletrequest).toString();
int i;
if((i = s.indexOf("?")) > 0)
s = s.substring(0, i);
String s1;
if((s1 = httpservletrequest.getQueryString()) == null)
s1 = "";
else
s1 = decode(s1);
if(s1.length() == 0)
httpservletresponse.setContentType("text/html");
PrintWriter printwriter = httpservletresponse.getWriter();
printwriter.println("<html>");
printwriter.println("<br><br><br>Could not get file name ");
printwriter.println("</html>");
printwriter.flush();
printwriter.close();
return;
if(s1.indexOf(".." + separator) >= 0 || s1.indexOf("../") >= 0)
httpservletresponse.setContentType("text/html");
PrintWriter printwriter1 = httpservletresponse.getWriter();
printwriter1.println("<html>");
printwriter1.println("<br><br><br>Could not use this file name by the security restrictions ");
printwriter1.println("</html>");
printwriter1.flush();
printwriter1.close();
return;
File file = lookupFile(root + s1);
if(file == null)
httpservletresponse.setContentType("text/html");
PrintWriter printwriter2 = httpservletresponse.getWriter();
printwriter2.println("<html>");
printwriter2.println("<br><br><br>Could not read file " + s1);
printwriter2.println("</html>");
printwriter2.flush();
printwriter2.close();
return;
if(!file.exists() || !file.canRead())
httpservletresponse.setContentType("text/html");
PrintWriter printwriter3 = httpservletresponse.getWriter();
printwriter3.println("<html><font face=\"Arial\">");
printwriter3.println("<br><br><br>Could not read file " + s1);
printwriter3.print("<br>Reasons are: ");
if(!file.exists())
printwriter3.println("file does not exist");
else
printwriter3.println("file is not readable at this moment");
printwriter3.println("</font></html>");
printwriter3.flush();
printwriter3.close();
return;
String s2 = httpservletrequest.getHeader("Accept-Encoding");
boolean flag = false;
if(s2 != null && s2.indexOf("gzip") >= 0 && "true".equalsIgnoreCase(getInitParameter("gzip")))
flag = true;
if(flag)
httpservletresponse.setHeader("Content-Encoding", "gzip");
httpservletresponse.setHeader("Content-Disposition", "attachment;filename=\"" + s1 + "\"");
javax.servlet.ServletOutputStream servletoutputstream = httpservletresponse.getOutputStream();
GZIPOutputStream gzipoutputstream = new GZIPOutputStream(servletoutputstream);
dumpFile(root + s1, gzipoutputstream);
gzipoutputstream.close();
servletoutputstream.close();
} else
httpservletresponse.setContentType("application/octet-stream");
httpservletresponse.setHeader("Content-Disposition", "attachment;filename=\"" + s1 + "\"");
javax.servlet.ServletOutputStream servletoutputstream1 = httpservletresponse.getOutputStream();
dumpFile(root + s1, servletoutputstream1);
servletoutputstream1.flush();
servletoutputstream1.close();
private String getFromQuery(String s, String s1)
if(s == null)
return "";
int i = s.indexOf(s1);
if(i < 0)
return "";
String s2 = s.substring(i + s1.length());
if((i = s2.indexOf("&")) < 0)
return s2;
else
return s2.substring(0, i);
private void dumpFile(String s, OutputStream outputstream)
String s1 = s;
byte abyte0[] = new byte[4096];
try
BufferedInputStream bufferedinputstream = new BufferedInputStream(new FileInputStream(lookupFile(s1)));
int i;
while((i = bufferedinputstream.read(abyte0, 0, 4096)) != -1)
outputstream.write(abyte0, 0, i);
bufferedinputstream.close();
catch(Exception exception) { }
private String decode(String s)
StringBuffer stringbuffer = new StringBuffer(0);
for(int i = 0; i < s.length(); i++)
char c = s.charAt(i);
if(c == '+')
stringbuffer.append(' ');
else
if(c == '%')
char c1 = '\0';
for(int j = 0; j < 2; j++)
c1 *= '\020';
c = s.charAt(++i);
if(c >= '0' && c <= '9')
c1 += c - 48;
continue;
if((c < 'A' || c > 'F') && (c < 'a' || c > 'f'))
break;
switch(c)
case 65: // 'A'
case 97: // 'a'
c1 += '\n';
break;
case 66: // 'B'
case 98: // 'b'
c1 += '\013';
break;
case 67: // 'C'
case 99: // 'c'
c1 += '\f';
break;
case 68: // 'D'
case 100: // 'd'
c1 += '\r';
break;
case 69: // 'E'
case 101: // 'e'
c1 += '\016';
break;
case 70: // 'F'
case 102: // 'f'
c1 += '\017';
break;
stringbuffer.append(c1);
} else
stringbuffer.append(c);
return stringbuffer.toString();
public String getServletInfo()
return "A DownloadServlet servlet ";
private File lookupFile(String s)
File file = new File(s);
return file.isAbsolute() ? file : new File(context.getRealPath("/"), s);
private static final String DIR = "dir";
private static final String GZIP = "gzip";
private ServletContext context;
private String separator;
private String root;
private static final String VERSION = "ver. 1.6";
private static final String CPR = "A DownloadServlet servlet ";
}Can't be done, for obvious security reasons.
Would you want someone downloading something into your windows\system directory when you navigate to their webpage? -
Problem description:
Computer takes a long time to fire up. Spinning ball is seen during start up, sometimes when login dialog box, and sometimes after entering login password. My mac freeze often, especially when using Lightroom…. Help is much appreciated!
EtreCheck version: 2.0.11 (98)
Report generated 3. november 2014 kl. 01.23.41 CET
Hardware Information: ℹ️
MacBook Pro (13-inch, Mid 2010) (Verified)
MacBook Pro - model: MacBookPro7,1
1 2.4 GHz Intel Core 2 Duo CPU: 2-core
4 GB RAM Upgradeable
BANK 0/DIMM0
2 GB DDR3 1067 MHz ok
BANK 1/DIMM0
2 GB DDR3 1067 MHz ok
Bluetooth: Old - Handoff/Airdrop2 not supported
Wireless: en1: 802.11 a/b/g/n
Video Information: ℹ️
NVIDIA GeForce 320M - VRAM: 256 MB
Color LCD 1280 x 800
System Software: ℹ️
OS X 10.10 (14A389) - Uptime: 2:49:19
Disk Information: ℹ️
Samsung SSD 840 EVO 500GB disk0 : (500,11 GB)
S.M.A.R.T. Status: Verified
EFI (disk0s1) <not mounted> : 210 MB
Macintosh HD (disk0s2) / [Startup]: 499.25 GB (260.35 GB free)
Recovery HD (disk0s3) <not mounted> [Recovery]: 650 MB
MATSHITADVD-R UJ-898
USB Information: ℹ️
Apple Inc. Built-in iSight
Apple Internal Memory Card Reader
Apple Inc. BRCM2046 Hub
Apple Inc. Bluetooth USB Host Controller
Apple Computer, Inc. IR Receiver
Apple Inc. Apple Internal Keyboard / Trackpad
Configuration files: ℹ️
/etc/sysctl.conf - Exists
/etc/hosts - Count: 15
Gatekeeper: ℹ️
Mac App Store and identified developers
Kernel Extensions: ℹ️
/Applications/IPVanish.app
[not loaded] foo.tap (1.0) Support
[not loaded] foo.tun (1.0) Support
/Applications/LaCie Desktop Manager.app
[not loaded] com.LaCie.ScsiType00 (1.2.13 - SDK 10.5) Support
[not loaded] com.jmicron.driver.jmPeripheralDevice (2.0.4) Support
[not loaded] com.lacie.driver.LaCie_RemoteComms (1.0.1 - SDK 10.5) Support
[not loaded] com.oxsemi.driver.OxsemiDeviceType00 (1.28.13 - SDK 10.5) Support
/Applications/Private Eye.app
[loaded] com.radiosilenceapp.nke.PrivateEye (1 - SDK 10.7) Support
/Library/Application Support/HASP/kexts
[not loaded] com.aladdin.kext.aksfridge (1.0.2) Support
/System/Library/Extensions
[loaded] com.hzsystems.terminus.driver (4) Support
[not loaded] com.nvidia.CUDA (1.1.0) Support
[not loaded] com.roxio.BluRaySupport (1.1.6) Support
[not loaded] com.sony.filesystem.prodisc_fs (2.3.0) Support
[not loaded] com.sony.protocol.prodisc (2.3.0) Support
/Users/[redacted]/Library/Services/ToastIt.service/Contents/MacOS
[not loaded] com.roxio.TDIXController (2.0) Support
Startup Items: ℹ️
CUDA: Path: /System/Library/StartupItems/CUDA
ProTec6b: Path: /Library/StartupItems/ProTec6b
Startup items are obsolete and will not work in future versions of OS X
Launch Agents: ℹ️
[not loaded] com.adobe.AAM.Updater-1.0.plist Support
[running] com.adobe.AdobeCreativeCloud.plist Support
[loaded] com.adobe.CS5ServiceManager.plist Support
[running] com.digitalrebellion.EditmoteListener.plist Support
[loaded] com.google.keystone.agent.plist Support
[loaded] com.intego.backupassistant.agent.plist Support
[running] com.mcafee.menulet.plist Support
[invalid?] com.mcafee.reporter.plist Support
[loaded] com.nvidia.CUDASoftwareUpdate.plist Support
[loaded] com.oracle.java.Java-Updater.plist Support
[running] com.orbicule.WitnessUserAgent.plist Support
[loaded] com.xrite.device.softwareupdate.plist Support
Launch Daemons: ℹ️
[loaded] com.adobe.fpsaud.plist Support
[invalid?] com.adobe.SwitchBoard.plist Support
[running] com.aladdin.aksusbd.plist Support
[failed] com.aladdin.hasplmd.plist Support
[running] com.edb.launchd.postgresql-8.4.plist Support
[loaded] com.google.keystone.daemon.plist Support
[running] com.intego.BackupAssistant.daemon.plist Support
[loaded] com.ipvanish.helper.openvpn.plist Support
[loaded] com.ipvanish.helper.pppd.plist Support
[invalid?] com.mcafee.ssm.ScanFactory.plist Support
[invalid?] com.mcafee.ssm.ScanManager.plist Support
[running] com.mcafee.virusscan.fmpd.plist Support
[loaded] com.mvnordic.mvlicensehelper.offline.plist Support
[loaded] com.oracle.java.Helper-Tool.plist Support
[loaded] com.oracle.java.JavaUpdateHelper.plist Support
[running] com.orbicule.witnessd.plist Support
[loaded] com.radiosilenceapp.nke.PrivateEye.plist Support
[running] com.xrite.device.xrdd.plist Support
User Launch Agents: ℹ️
[loaded] com.adobe.AAM.Updater-1.0.plist Support
[loaded] com.adobe.ARM.[...].plist Support
[invalid?] com.digitalrebellion.SoftwareUpdateAutoCheck.plist Support
[loaded] com.facebook.videochat.[redacted].plist Support
[loaded] com.macpaw.CleanMyMac2Helper.scheduledScan.plist Support
[loaded] com.macpaw.CleanMyMac2Helper.trashWatcher.plist Support
[running] com.spotify.webhelper.plist Support
User Login Items: ℹ️
Skype Program (/Applications/Skype.app)
GetBackupAgent Program (/Users/[redacted]/Library/Application Support/BeLight Software/Get Backup 2/GetBackupAgent.app)
PhoneViewHelper Program (/Users/[redacted]/Library/Application Support/PhoneView/PhoneViewHelper.app)
EarthDesk Core UNKNOWN (missing value)
Dropbox Program (/Applications/Dropbox.app)
AdobeResourceSynchronizer ProgramHidden (/Applications/Adobe Reader.app/Contents/Support/AdobeResourceSynchronizer.app)
i1ProfilerTray Program (/Applications/i1Profiler/i1ProfilerTray.app)
Internet Plug-ins: ℹ️
Google Earth Web Plug-in: Version: 6.0 Support
Default Browser: Version: 600 - SDK 10.10
AdobeAAMDetect: Version: AdobeAAMDetect 2.0.0.0 - SDK 10.7 Support
FlashPlayer-10.6: Version: 15.0.0.189 - SDK 10.6 Support
AdobePDFViewerNPAPI: Version: 11.0.09 - SDK 10.6 Support
Silverlight: Version: 5.1.10411.0 - SDK 10.6 Support
Flash Player: Version: 15.0.0.189 - SDK 10.6 Support
QuickTime Plugin: Version: 7.7.3
iPhotoPhotocast: Version: 7.0
SiteAdvisor: Version: 2.0 - SDK 10.1 Support
AdobePDFViewer: Version: 11.0.09 - SDK 10.6 Support
GarminGPSControl: Version: 3.0.1.0 Release - SDK 10.4 Support
JavaAppletPlugin: Version: Java 7 Update 71 Check version
User Internet Plug-ins: ℹ️
Google Earth Web Plug-in: Version: 6.2 Support
F5 Inspection Host Plugin: Version: 6031.2010.0122.1 Support
f5 sam inspection host plugin: Version: 7000.2010.0602.1 Support
Safari Extensions: ℹ️
Facebook Cleaner
Better Facebook
SiteAdvisor
Incognito
Bing Highlights
YouTube5
AdBlock
YoutubeWide
Audio Plug-ins: ℹ️
DVCPROHDAudio: Version: 1.3.2
3rd Party Preference Panes: ℹ️
CUDA Preferences Support
EarthDesk Support
Editmote Support
Flash Player Support
FUSE for OS X (OSXFUSE) Support
Growl Support
Java Support
Witness Support
Time Machine: ℹ️
Time Machine not configured!
Top Processes by CPU: ℹ️
13% taskgated
12% WindowServer
1% WitnessUserAgent
1% sysmond
1% Activity Monitor
Top Processes by Memory: ℹ️
327 MB com.apple.WebKit.WebContent
137 MB softwareupdated
94 MB Safari
82 MB VShieldScanner
82 MB Dock
Virtual Memory Information: ℹ️
65 MB Free RAM
1.58 GB Active RAM
1.54 GB Inactive RAM
647 MB Wired RAM
2.95 GB Page-ins
260 MB Page-outsYou have SCADS of extensions and the things running. McAfee, Intego, Orbicule, CleanMyMac, and others I've not ever even heard of. My first recommendation would be to remove all of these and see if things improve.
-
New to Dialog Boxes and I'm stuck
Seems there is no way to format a field in a Dialog Box. How can a field be checked to determine if the correct type of data was entered in it, when the user moves to the next field, before data is committed?
I am stuck on how to limit the number of characters entered into the postal code and phone fields. I want to limit the number of numeric characters that can be entered in each phonenumber field ie 3 numbers, 3numbers and 4 numbers (999 999 9999) And postal code field ie 3 characters and 3 characters (A9A 9A9)
Also, once the user enters the required number of characters in the phone and postal code fields, the code should tab to the next field. And yes, I read about tab_first and next_tab, but don't understand how it works. The way I see it working is that once a phone or postal code field is filled with the required number of characters, control automatically tabs to the next field.
I am using Adobe Acrobat Professional 8
This code was written by trail and error using examples from various sources ie Acrobat JavaScript Scripting reference - version 7.0.5, Acrobat JavaScript Scripting Guide - version 7.0, and I have very little experience in creating a dialog box and its code - forgive the mess.
//============================================================================
var goon=true;
var result;
var address;
var city;
var province;
var sign;
var postalcodea;
var postalcodeb;
var homephone;
var homephoneareacode;
var homephoneprefix;
var homephonenumber;
var businessphone;
var businessphoneareacode;
var businessphoneprefix;
var businessphonenumber;
address = this.getField("Text1-2-Address").value;
city = this.getField("Text1-2-City").value;
var provincelist = new Array();
provincelist[1] = " ";
provincelist[2] = "Alberta";
provincelist[3] = "British Columbia";
provincelist[4] = "Manitoba";
provincelist[5] = "New Brunswick";
provincelist[6] = "Newfoundland & Labrador";
provincelist[7] = "Northwest Territories";
provincelist[8] = "Nova Scotia";
provincelist[9] = "Nunavut";
provincelist[10] = "Ontario";
provincelist[11] = "Prince Edward Island";
provincelist[12] = "Québec";
provincelist[13] = "Saskatchewan";
provincelist[14] = "Yukon";
var sign = new Array();
for (var i=0; i<15; i++)
sign[i] = "-";
if(provincelist[i] == this.getField("Client's Full Province Name").value)
sign[i] = "+";
postalcodea = "";
postalcodeb = "";
if(this.getField("Text1-2-Postal-Code").value != "")
postalcodea = this.getField("Text1-2-Postal-Code").value;
postalcodea = util.printx("A9A", postalcodea);
postalcodeb = this.getField("Text1-2-Postal-Code").value;
postalcodeb = postalcodeb[4] + postalcodeb[5] + postalcodeb[6];
homephoneareacode = "";
homephoneprefix = "";
homephonenumber = "";
if(this.getField("Text1-2-Home-Phone-Number").value != "")
homephone = util.printx("9999999999", this.getField("Text1-2-Home-Phone-Number").value);
homephoneareacode = homephone[0] + homephone[1] + homephone[2];
homephoneprefix = homephone[3] + homephone[4] + homephone[5];
homephonenumber = homephone[6] + homephone[7] + homephone[8] + homephone[9];
businessphoneareacode = "";
businessphoneprefix = "";
businessphonenumber = "";
if(this.getField("Text1-2-Business-Phone-Number").value != "")
businessphone = util.printx("9999999999", this.getField("Text1-2-Business-Phone-Number").value);
businessphoneareacode = businessphone[0] + businessphone[1] + businessphone[2];
businessphoneprefix = businessphone[3] + businessphone[4] + businessphone[5];
businessphonenumber = businessphone[6] + businessphone[7] + businessphone[8] + businessphone[9];
var dialog2 =
initialize: function(dialog)
dialog.load(
stat: "Client Address and Phone Information is required in forms you are about to link to. To save time, enter Address and Phone Information before linking to these documents.",
str1: address,
str2: city,
stra: postalcodea,
strb: postalcodeb,
str5: homephoneareacode,
str6: homephoneprefix,
str7: homephonenumber,
str8: businessphoneareacode,
str9: businessphoneprefix,
sts1: businessphonenumber,
str3:
" ": (sign[1] + "1"),
"Alberta": (sign[2] + "2"),
"British Columbia": (sign[3] + "3"),
"Manitoba": (sign[4] + "4"),
"New Brunswick": (sign[5] + "5"),
"Newfoundland & Labrador": (sign[6] + "6"),
"Northwest Territories": (sign[7] + "7"),
"Nova Scotia": (sign[8] + "8"),
"Nunavut": (sign[9] + "9"),
"Ontario": (sign[10] + "10"),
"Prince Edward Island": (sign[11] + "11"),
"Québec": (sign[12] + "12"),
"Saskatchewan": (sign[13] + "13"),
"Yukon": (sign[14] + "14"),
cancel: function(dialog)
return;
destroy: function(dialog)
return;
commit:function (dialog)
results = dialog.store();
var elements = dialog.store() ["str3"]
province = "";
for(var i in elements)
if(elements[i] > 0)
province = i;
return;
description:
name: "Address and Phone Information",
//align_children: "align_left",
//type: "static_text",
//char_height: 9,
//width: 350,
//height: 75,
elements:
type: "cluster",
name: "",
align_children: "align_left",
elements:
align_children: "align_top",
alignment: "align_fill",
type: "view",
width: 254,
elements:
alignment: "align_fill",
bold: true,
font: "default",
char_height: 9,
italic: true,
item_id: "stat",
multiline: false,
type: "static_text",
width: 150,
height: 50,
type: "view",
align_children: "align_distribute",
elements:
type: "static_text",
name: "Address: "
item_id: "str1",
type: "edit_text",
alignment: "align_left",
char_width: 60,
height: 20,
type: "view",
align_children: "align_distribute",
elements:
type: "static_text",
name: " City: "
item_id: "str2",
type: "edit_text",
alignment: "align_left",
char_width: 16,
height: 20,
type: "static_text",
name: "Province: "
item_id: "str3",
type: "popup",
alignment: "align_left",
char_width: 16,
type: "static_text",
name: "Postal Code: "
item_id: "stra",
type: "edit_text",
alignment: "align_left",
char_width: 3,
height: 20,
type: "static_text",
name: "-"
item_id: "strb",
type: "edit_text",
alignment: "align_left",
char_width: 3,
height: 20,
type: "view",
align_children: "align_distribute",
elements:
type: "static_text",
name: "Home Phone Number: ("
item_id: "str5",
type: "edit_text",
alignment: "align_left",
char_width: 3,
height: 20,
next_tab: 3,
type: "static_text",
name: ")"
item_id: "str6",
type: "edit_text",
alignment: "align_left",
char_width: 3,
height: 20,
type: "static_text",
name: "-"
item_id: "str7",
type: "edit_text",
alignment: "align_left",
char_width: 4,
height: 20,
type: "static_text",
name: "Business Phone Number: ("
item_id: "str8",
type: "edit_text",
alignment: "align_left",
char_width: 3,
height: 20,
type: "static_text",
name: ")"
item_id: "str9",
type: "edit_text",
alignment: "align_left",
char_width: 3,
height: 20,
type: "static_text",
name: "-"
item_id: "sts1",
type: "edit_text",
alignment: "align_left",
char_width: 4,
height: 20,
alignment: "align_center",
type: "ok_cancel",
ok_name: "Continue",
cancel_name: "Cancel"
var dialog3 =
initialize: function (dialog)
cancel: function(dialog)
goon=false;
return;
destroy: function(dialog)
return;
while (goon)
result = app.execDialog(dialog2);
if (result=="cancel")
goon=false;
if (result=="ok")
this.getField("Text1-2-Address").value = results["str1"];
this.getField("Text1-2-City").value = results["str2"];
this.getField("Client's Full Province Name").value = province;
this.getField("Text1-2-Postal-Code").value = results["stra"] + " " + results["strb"];
this.getField("Text1-2-Home-Phone-Number").value = results["str5"] + results["str6"] + results["str7"];
this.getField("Text1-2-Business-Phone-Number").value = results["str8"] + results["str9"] + results["sts1"];
goon=false;If you know a link that has what he wants, wouldn't it be prudent just to provide that?
I got overwhelmed trying to understand all of the different related elements of the Flash family when I was starting, so I know what that's like. Roughly (and Ned might want to correct or clarify some of this), Actionscript 3 is the programming language Flash/Flex/AIR content is based upon. Flash is a blanket term encompassing the developing environment (Flash Pro), code libraries, and runtime (Flash Player). AIR is a runtime environment built upon Flash Player, but with added functionality and cross-platform support. Flex is an extension of Flash, offering MXML components in addition to the libraries available in Flash Pro. Adobe intends for you to use Flex with Flash Builder, a separate IDE built upon Eclipse.
I haven't used MXML yet, but my impression is that (at least in Flash Builder) it is functionally similar to WYSIWYG editing in Microsoft's Visual Studio.
If you are developing games, you can edit entirely in Flash Pro, entirely in Flash Builder, or combine both of them. Flash Pro lets you put code on the timeline, which can make some coding much easier, but also makes it very, very easy to write messy and disorganized code. Flash Builder doesn't provide access to the timeline and is intended for class-based development. Personally, I like to combine the two, writing some timeline code in Pro and doing my class files in Builder, but I'm not the greatest developer.
As a heads-up, the code editor in Flash Pro is absolutely terrible, and is full of bugs that have existed for many generations, because Adobe wants you to buy Flash Builder for the additional $600, but if you are a student or "unemployed", you can get FB for free from Adobe. -
Image looks great in PS- when I go to print, it looks grainy in printer preview dialog box and prints blurry. Why is this happening?
PS CC, Yosemite, Epson 3880 (called espson to make sure it wasn't something with that), saved as a tiff/psdjpg- all files behave the same way. When I open the raw file- and only crop the image- it behaves this way now- with grain and blur when printing. No other files do this in the same shoot. I worked on this image- could something have gotten corrupted along the way such that now even opening the raw file creates this problem. SInce upgrading my computer - a window pops up when I open PS that says I need to update my graphics card?? for 3D- I'm not using 3D- so I don't know if that means anything. I have to leave for about an hour- but greatly appreciate any feedback. I will be in touch. Thank you.
-
How do I get rid of the dialog box and audio that is in the bottom left corner of the screen running script and audio of what I'm doing or need to do?
Go into System Preferences, select Universal Access, turn off Voiceover.
-
Why can I sometimes paste text into a revision history dialog box and other times cannot?
Why can I sometimes paste copied text (from another VI's revision history, for instance or from anywhere else) into a revision history dialog box and other times cannot? All versions of LabVIEW! It's something like the control key becomes diabled. I've noticed the same thing when saving many VI's at once, some will let you paste into revision history and others will not. Aren't all VI's created equally when it comes to revision history? All versions of LabVIEW since 3 have plagued me with this problem.
Hello,
If you'd like to add text to the revision history of a VI, you can
paste into the Comment box and add all of your text at once. The
history itself can be read from this window, but cannot be directly
edited. The History field is read-only in the dialog box.
If you feel this should not be the case, your best course of action is
to express your desire for added functionality to our developers on the Product Feedback page of our website.
Message Edited by MattP on 12-19-2006 12:04 PM
Cheers,
Matt Pollock
National Instruments -
Print Dialog box and User Code on Reader 10
Hello,
I recently updated to Adobe Reader 10 and when I go to print there is apparently a new adobe print dialog box. Which is ok except that it doesn't seem to get my user code info. When I print using the printer... button it prints fine. But if I push ok from the new adobe print dialog it causes an authentication error in the log on the printer. Is there anyway to put in my user code to adobe reader so I don't have to do this extra step? Can I turn off the new Adobe print dialog box and have it just go directly to the OS print dialog box like it used to?
Thanks,
daveCan you tell us if you are using Windows of Mac OS? The Mac OS version of Reader has a Printer button on the bottom of the Print dialog box that brings up the standard printer dialog box.
-
Open Dialog Box: full file name is not displayed in edit window under Windows 7
Only the last 16 characters of a file name are displayed in the edit window of a Common dialog box under Windows 7. What is the fix to this problem? I am coding in C/C++ and my compiler is Visual Studio 2005.
Hi warengharding624,
Based on your description, your issue is related about C/C++, since this forum is discussing about Windows Forms Controls, and I will move this thread to C++ forum.
In addition,Could you share us what the type of your project is?
Thanks for your understanding.
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
Need action to open save dialog box and STOP there. Help!!
So here is the background info, in case it helps to know why I am looking for this option - I am pulling photos off an internal company database. I can not access these photos as regular files - I have to go to our website, input an employee number, and right click, copy. Therefore, any options related to batch editing, if they'd even help otherwise, are out for this first step
In the meantime, I have created an action that opens a new doc, pastes the photo in, and resizes it. Assigned f5 as the shortcut. Then, to save my dexterity (:P) I also reassigned the "open save for web & devices" shortcut to f6.
However, this is such a massive project, and coming to a time-crunch, that I'd really like to take the action I created even further to cut out that second step (open save w/ f6).
I've googled and apparently am not phrasing the question right, no matter how hard I try.
HOW in the world, if possible, can I add a step to my action that simply OPENS the save for web & devices dialog box? I know how to make it open and save, but no more than that. I need to open and just STOP there, so that I can simply hit enter and input the desired file name.
Is this possible?! I'll love you forever if you can tell me that it is and how to accomplish it! Btw, I am on Photoshop CS4.For your F6 save files action, record it saving a file (it doesn't matter what or where for the moment)
Now, in the actions palette, click the right hand box where your save action is. A dialogue box will pop up saying "This will toggle the state of all dialogs in this action..." Click ok beacause we want to hand over control of the save back to the user. Now, when you run your save action the dialogue will appear and you can save the file where and as you want.
Hope this helps. -
Deadlock between "Save as" dialog box and another popup window in Firefox
I have only seen this problem with recent versions of Firefox on Mac OS X, and I have run into it several times in the last few months (I am using Firefox 9), where Firefox seems to get into a dead-lock, and I can't find anyway round this except killing and restarting Firefox.
The dead-lock happens when I am in the "Save as" dialog box -- i.e. the popup when I try to save something. If I get a pop-up window warning me that the script on some webpage is unresponsive, this leads to a dead-lock. The reason is this popup expects a response from me -- to stop or let the script continue, but it is unable to accept my response, I assume because the "Save As" dialog box has the focus, but I am unable to continue with the "Save As" dialog (I simply get a beep if I press the save or cancel buttons), presumably because of the "unresponsive" popup is expecting my response.
I don't know if the "unresponsive script" popup happens because I am taking too long with the "Save As" dialog, or if it is prompted by the script from another page (I have many tabs opened)
Is there anyway to get around this without killing the Firefox process? Also, can this problem be fixed so that the dead-lock does not occur?As I said, the problem is not because Firefox is hanging, or because I cannot save my files. It is happening because the "unrespnsive script" popup is allowed to occur while I am in the "Save As" dialog -- i.e. I have chosen to save something, e.g. a web page, and this prompt the "Save As" dialog, i.e. where I specify the file name and where to save to -- this is working fine.
However, when you are in the "Save As" dialog, the "Save As" window is the only window of Firefox that you can interact with. However, if the "unresponsive script" popup window happens to pop-up when you are inside the "Save As" dialog (which does not occur very often, and I have not encounter it except on recent versions of Firefox o the Mac; I have used Firefox on Windows and Linux for many years), then you get into this dead-lock, because you cannot answer the "unresponsive script" pop-up (i.e to continue or terminate the script), as you cannot interact with the new pop-up window, but at the same time, you cannot continue with the "Save As" dialog -- you can interact with the "Save As" window (i.e. press buttons etc.), but the actions are ignored.
To be clear, what I suspect I am seeing is a bug in the User interface code for the Mac version of Firefox.
I have noticed yesterday that I got an "unresponsive script" pop-up on the Windows version of Firefox immediately after I have finished my "Save As" dialog. I have no way of being certain (unless I look at the code), but my guess is that the "unresponsive script" pop-up was delayed until after I finished the "Save As" dialog on the Windows version, i.e. option 3 in my previous post, but this does not seem to happen on the Mac version. -
Awesome3 dialog boxes and pop-ups appearing partly offscreen
Dialog boxes like when opening a specific file in evince (with C-o or file->open) are appearing floating (as they should) but with almost half of the box offscreen. Its irritating to have to move my hand to my mouse every time and move the window into full view as otherwise I use the keyboard exclusively, so I'm wondering if anyone knows how to set a default location on screen for pop-up dialog boxes like this.
Thanks for any help provided.
here is my rc.lua:
-- awesome 3 configuration file
-- Include awesome library, with lots of useful function!
require("awful")
require("tabulous")
require("beautiful")
--extra non-default library
require("wicked")
-- {{{ Variable definitions
-- This is a file path to a theme file which will defines colors.
theme_path = "/home/ojcp/.config/awesome/themes/default"
-- This is used later as the default terminal to run.
terminal = "terminal"
editor = "emacs"
browserName = "Gran Paradiso"
browser = "firefox"
pdfview = "evince"
office = "abiword"
spreadsheet = "Gnumeric"
-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key,
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
-- However, you can use another modifier like Mod1, but it may interact with others.
modkey = "Mod4"
-- Table of layouts to cover with awful.layout.inc, order matters.
layouts =
"tile",
"tileleft",
"tilebottom",
"tiletop",
"fairh",
"fairv",
"magnifier",
"max",
"spiral",
"dwindle",
"floating"
-- Table of clients that should be set floating. The index may be either
-- the application class or instance. The instance is useful when running
-- a console app in a terminal like (Music on Console)
-- xterm -name mocp -e mocp
floatapps =
-- by class
["MPlayer"] = true,
["pinentry"] = true,
["gimp"] = true,
-- by instance
["mocp"] = true
-- Applications to be moved to a pre-defined tag by class or instance.
-- Use the screen and tags indices.
apptags =
[browserName] = {screen = 1, tag = 2},
[editor] = {screen = 1, tag = 4},
[office] = {screen = 1, tag = 3},
[pdfview] = {screen = 1, tag = 3},
[spreadsheet] = {screen = 1, tag = 3}
-- Define if we want to use titlebar on all applications.
use_titlebar = false
-- {{{ Initialization
-- Initialize theme (colors).
beautiful.init(theme_path)
-- Register theme in awful.
-- This allows to not pass plenty of arguments to each function
-- to inform it about colors we want it to draw.
awful.beautiful.register(beautiful)
-- Uncomment this to activate autotabbing
-- tabulous.autotab_start()
-- {{{ Tags
-- Define tags table.
tags = {}
for s = 1, screen.count() do
-- Each screen has its own tag table.
tags[s] = {}
tagnames = {"chmu","net","doc","emacs", "misc", "float"}
-- Create 9 tags per screen.
for tagnumber = 1, 6 do
if tagnumber < 6 then
tags[s][tagnumber] = tag({ name = tagnames[tagnumber], layout = layouts[1] })
else
tags[s][tagnumber] = tag({ name = tagnames[tagnumber], layout = layouts[11] })
end
-- Add tags to screen one by one
tags[s][tagnumber].screen = s
end
-- I'm sure you want to see at least one tag.
tags[s][1].selected = true
end
-- {{{ Statusbar
-- Create a taglist widget
mytaglist = widget({ type = "taglist", name = "mytaglist" })
mytaglist:mouse_add(mouse({}, 1, function (object, tag) awful.tag.viewonly(tag) end))
mytaglist:mouse_add(mouse({ modkey }, 1, function (object, tag) awful.client.movetotag(tag) end))
mytaglist:mouse_add(mouse({}, 3, function (object, tag) tag.selected = not tag.selected end))
mytaglist:mouse_add(mouse({ modkey }, 3, function (object, tag) awful.client.toggletag(tag) end))
mytaglist:mouse_add(mouse({ }, 4, awful.tag.viewnext))
mytaglist:mouse_add(mouse({ }, 5, awful.tag.viewprev))
mytaglist.label = awful.widget.taglist.label.all
-- Create a tasklist widget
mytasklist = widget({ type = "tasklist", name = "mytasklist" })
mytasklist:mouse_add(mouse({ }, 1, function (object, c) client.focus = c; c:raise() end))
mytasklist:mouse_add(mouse({ }, 4, function () awful.client.focusbyidx(1) end))
mytasklist:mouse_add(mouse({ }, 5, function () awful.client.focusbyidx(-1) end))
mytasklist.label = awful.widget.tasklist.label.currenttags
-- Create a textbox widget
mytextbox = widget({ type = "textbox", name = "mytextbox", align = "right" })
-- Set the default text in textbox
mytextbox.text = "<b><small> awesome " .. AWESOME_VERSION .. " </small></b>"
mypromptbox = widget({ type = "textbox", name = "mypromptbox", align = "left" })
-- Create an iconbox widget
myiconbox = widget({ type = "textbox", name = "myiconbox", align = "left" })
myiconbox.text = "<bg image=\"/usr/share/awesome/icons/awesome16.png\" resize=\"true\"/>"
-- Create a systray
mysystray = widget({ type = "systray", name = "mysystray", align = "right" })
-- Create an iconbox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.
mylayoutbox = {}
for s = 1, screen.count() do
mylayoutbox[s] = widget({ type = "textbox", name = "mylayoutbox", align = "right" })
mylayoutbox[s]:mouse_add(mouse({ }, 1, function () awful.layout.inc(layouts, 1) end))
mylayoutbox[s]:mouse_add(mouse({ }, 3, function () awful.layout.inc(layouts, -1) end))
mylayoutbox[s]:mouse_add(mouse({ }, 4, function () awful.layout.inc(layouts, 1) end))
mylayoutbox[s]:mouse_add(mouse({ }, 5, function () awful.layout.inc(layouts, -1) end))
mylayoutbox[s].text = "<bg image=\"/usr/share/awesome/icons/layouts/tilew.png\" resize=\"true\"/>"
end
-- Create battery widget
batterytext = widget({type = "textbox", name = "batterytext", align = "right"})
batterytext.text = " bat: "
mybatterymonitor = widget({type = "progressbar", name = "batterywidget", align = "right" })
mybatterymonitor.width = 50
mybatterymonitor.height = 0.6
mybatterymonitor.border_padding = 1
mybatterymonitor.border_width = 1
mybatterymonitor.ticks_count = 20
mybatterymonitor.ticks_gap = 1
mybatterymonitor.vertical = false
mybatterymonitor:bar_properties_set('bat', {
bg = 'black',
fg = 'blue4',
fg_off = 'black',
reverse = false,
min_value = 0,
max_value = 100
-- Create membar
membartext = widget({ type = "textbox", name = "membartext", align = "right" })
membartext.text = " mem: "
membarwidget = widget({
type = 'progressbar',
name = 'membarwidget',
align = 'right'
membarwidget.width = 50
membarwidget.height = 0.6
membarwidget.border_padding = 1
membarwidget.gap = 5
membarwidget.ticks_count = 20
membarwidget.ticks_gap = 1
membarwidget:bar_properties_set('mem', {
bg = 'black',
fg = '#285577',
fg_center = '#285577',
fg_end = '#285577',
fg_off = 'black',
reverse = false,
min_value = 0,
max_value = 100
wicked.register(membarwidget, wicked.widgets.mem, '$1', 1, 'mem')
-- CPU graph
cputext = widget ({ type = "textbox", name = "cputext", align = "right"})
cputext.text = " cpu: "
cpugraphwidget = widget({
type = 'graph',
name = 'cpugraphwidget',
align = 'right'
cpugraphwidget.height = 0.85
cpugraphwidget.width = 45
cpugraphwidget.bg = 'black'
cpugraphwidget.border_width = 1
cpugraphwidget.grow = 'left'
cpugraphwidget:plot_properties_set('cpu', {
fg = '#AEC6D8',
fg_center = '#285577',
fg_end = '#285577',
vertical_gradient = false
wicked.register(cpugraphwidget, wicked.widgets.cpu, '$1', 1, 'cpu')
-- mpd display
--mpdwidget = widget({
-- type = 'textbox',
-- name = 'mpdwidget',
-- align = 'left'
--wicked.register(mpdwidget, wicked.widgets.mpd,
-- function (widget, args)
-- if args[1]:find("volume:") == nil then
-- return ' <span color="white">Now Playing:</span> '..args[1]
-- else
-- return ''
-- end
-- end)
-- Create a statusbar for each screen and add it
mystatusbar = {}
for s = 1, screen.count() do
mystatusbar[s] = statusbar({ position = "top", name = "mystatusbar" .. s,
fg = beautiful.fg_normal, bg = beautiful.bg_normal })
-- Add widgets to the statusbar - order matters
mystatusbar[s]:widgets({
mytaglist,
--mytasklist,
myiconbox,
mypromptbox,
mytasklist,
--mpdwidget,
cputext,
cpugraphwidget,
membartext,
membarwidget,
batterytext,
mybatterymonitor,
mytextbox,
mylayoutbox[s],
s == 1 and mysystray or nil
mystatusbar[s].screen = s
end
--bottomStatusBar = {}
--for s = 1, screen.count() do
-- bottomStatusBar[s] = statusbar({ position = "bottom", name = "bottomStatusBar" .. s,
-- fg = beautiful.fg_normal, bg = beautiful.bg_normal })
-- -- Add widgets to the statusbar - order matters
-- bottomStatusBar[s]:widgets({
-- --mytaglist,
-- mytasklist,
-- --myiconbox,
-- --mypromptbox,
-- --testbox,
-- --mytextbox,
-- --mylayoutbox[s],
-- --s == 1 and mysystray or nil
-- bottomStatusBar[s].screen = s
--end
-- {{{ Mouse bindings
awesome.mouse_add(mouse({ }, 3, function () awful.spawn(terminal) end))
awesome.mouse_add(mouse({ }, 4, awful.tag.viewnext))
awesome.mouse_add(mouse({ }, 5, awful.tag.viewprev))
-- {{{ Key bindings
-- Bind keyboard digits
-- Compute the maximum number of digit we need, limited to 9
keynumber = 0
for s = 1, screen.count() do
keynumber = math.min(9, math.max(#tags[s], keynumber));
end
for i = 1, keynumber do
keybinding({ modkey }, i,
function ()
local screen = mouse.screen
if tags[screen][i] then
awful.tag.viewonly(tags[screen][i])
end
end):add()
keybinding({ modkey, "Control" }, i,
function ()
local screen = mouse.screen
if tags[screen][i] then
tags[screen][i].selected = not tags[screen][i].selected
end
end):add()
keybinding({ modkey, "Shift" }, i,
function ()
local sel = client.focus
if sel then
if tags[sel.screen][i] then
awful.client.movetotag(tags[sel.screen][i])
end
end
end):add()
keybinding({ modkey, "Control", "Shift" }, i,
function ()
local sel = client.focus
if sel then
if tags[sel.screen][i] then
awful.client.toggletag(tags[sel.screen][i])
end
end
end):add()
end
keybinding({ modkey }, "Left", awful.tag.viewprev):add()
keybinding({ modkey }, "Right", awful.tag.viewnext):add()
keybinding({ modkey }, "Escape", awful.tag.history.restore):add()
-- Standard program
keybinding({ modkey }, "Return", function () awful.spawn(terminal) end):add()
keybinding({ }, "F4", function () awful.spawn(browser) end):add()
keybinding({ modkey, "Control" }, "r", awesome.restart):add()
keybinding({ modkey, "Shift" }, "q", awesome.quit):add()
-- Client manipulation
keybinding({ modkey }, "m", awful.client.maximize):add()
keybinding({ modkey, "Shift" }, "c", function () client.focus:kill() end):add()
keybinding({ modkey }, "d", function () awful.client.focusbyidx(1); client.focus:raise() end):add()
keybinding({ modkey }, "f", function () awful.client.focusbyidx(-1); client.focus:raise() end):add()
keybinding({ modkey, "Shift" }, "d", function () awful.client.swap(1) end):add()
keybinding({ modkey, "Shift" }, "f", function () awful.client.swap(-1) end):add()
keybinding({ modkey, "Control" }, "d", function () awful.screen.focus(1) end):add()
keybinding({ modkey, "Control" }, "f", function () awful.screen.focus(-1) end):add()
keybinding({ modkey, "Control" }, "space", awful.client.togglefloating):add()
keybinding({ modkey, "Control" }, "Return", function () client.focus:swap(awful.client.master()) end):add()
keybinding({ modkey }, "o", awful.client.movetoscreen):add()
keybinding({ modkey }, "Tab", awful.client.focus.history.previous):add()
keybinding({ modkey }, "u", awful.client.urgent.jumpto):add()
keybinding({ modkey, "Shift" }, "r", function () client.focus:redraw() end):add()
-- Layout manipulation
keybinding({ modkey }, "l", function () awful.tag.incmwfact(0.05) end):add()
keybinding({ modkey }, "h", function () awful.tag.incmwfact(-0.05) end):add()
keybinding({ modkey, "Shift" }, "h", function () awful.tag.incnmaster(1) end):add()
keybinding({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end):add()
keybinding({ modkey, "Control" }, "h", function () awful.tag.incncol(1) end):add()
keybinding({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end):add()
keybinding({ modkey }, "space", function () awful.layout.inc(layouts, 1) end):add()
keybinding({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end):add()
-- Prompt
keybinding({ modkey }, "F1", function ()
awful.prompt.run({ prompt = "Run: " }, mypromptbox, awful.spawn, awful.completion.bash,
os.getenv("HOME") .. "/.cache/awesome/history") end):add()
keybinding({ modkey }, "F4", function ()
awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox, awful.eval, awful.prompt.bash,
os.getenv("HOME") .. "/.cache/awesome/history_eval") end):add()
keybinding({ modkey, "Ctrl" }, "i", function ()
if mypromptbox.text then
mypromptbox.text = nil
else
mypromptbox.text = nil
if client.focus.class then
mypromptbox.text = "Class: " .. client.focus.class .. " "
end
if client.focus.instance then
mypromptbox.text = mypromptbox.text .. "Instance: ".. client.focus.instance .. " "
end
if client.focus.role then
mypromptbox.text = mypromptbox.text .. "Role: ".. client.focus.role
end
end
end):add()
--- Tabulous, tab manipulation
keybinding({ modkey, "Control" }, "y", function ()
local tabbedview = tabulous.tabindex_get()
local nextclient = awful.client.next(1)
if not tabbedview then
tabbedview = tabulous.tabindex_get(nextclient)
if not tabbedview then
tabbedview = tabulous.tab_create()
tabulous.tab(tabbedview, nextclient)
else
tabulous.tab(tabbedview, client.focus)
end
else
tabulous.tab(tabbedview, nextclient)
end
end):add()
keybinding({ modkey, "Shift" }, "y", tabulous.untab):add()
keybinding({ modkey }, "y", function ()
local tabbedview = tabulous.tabindex_get()
if tabbedview then
local n = tabulous.next(tabbedview)
tabulous.display(tabbedview, n)
end
end):add()
-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them
keybinding({ modkey }, "t", awful.client.togglemarked):add()
keybinding({ modkey, 'Shift' }, "t", function ()
local tabbedview = tabulous.tabindex_get()
local clients = awful.client.getmarked()
if not tabbedview then
tabbedview = tabulous.tab_create(clients[1])
table.remove(clients, 1)
end
for k,c in pairs(clients) do
tabulous.tab(tabbedview, c)
end
end):add()
for i = 1, keynumber do
keybinding({ modkey, "Shift" }, "F" .. i,
function ()
local screen = mouse.screen
if tags[screen][i] then
for k, c in pairs(awful.client.getmarked()) do
awful.client.movetotag(tags[screen][i], c)
end
end
end):add()
end
-- {{{ Hooks
-- Hook function to execute when focusing a client.
function hook_focus(c)
if not awful.client.ismarked(c) then
c.border_color = beautiful.border_focus
end
end
-- Hook function to execute when unfocusing a client.
function hook_unfocus(c)
if not awful.client.ismarked(c) then
c.border_color = beautiful.border_normal
end
end
-- Hook function to execute when marking a client
function hook_marked(c)
c.border_color = beautiful.border_marked
end
-- Hook function to execute when unmarking a client
function hook_unmarked(c)
c.border_color = beautiful.border_focus
end
-- Hook function to execute when the mouse is over a client.
function hook_mouseover(c)
-- Sloppy focus, but disabled for magnifier layout
if awful.layout.get(c.screen) ~= "magnifier" then
client.focus = c
end
end
-- Hook function to execute when a new client appears.
function hook_manage(c)
-- Set floating placement to be smart!
c.floating_placement = "smart"
if use_titlebar then
-- Add a titlebar
awful.titlebar.add(c, { modkey = modkey })
end
-- Add mouse bindings
c:mouse_add(mouse({ }, 1, function (c) client.focus = c; c:raise() end))
c:mouse_add(mouse({ modkey }, 1, function (c) c:mouse_move() end))
c:mouse_add(mouse({ modkey }, 3, function (c) c:mouse_resize() end))
-- New client may not receive focus
-- if they're not focusable, so set border anyway.
c.border_width = beautiful.border_width
c.border_color = beautiful.border_normal
client.focus = c
-- Check if the application should be floating.
local cls = c.class
local inst = c.instance
if floatapps[cls] then
c.floating = floatapps[cls]
elseif floatapps[inst] then
c.floating = floatapps[inst]
end
-- Check application->screen/tag mappings.
local target
if apptags[cls] then
target = apptags[cls]
elseif apptags[inst] then
target = apptags[inst]
end
if target then
c.screen = target.screen
awful.client.movetotag(tags[target.screen][target.tag], c)
end
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- awful.client.setslave(c)
-- Honor size hints
c.honorsizehints = true
end
-- Hook function to execute when arranging the screen
-- (tag switch, new client, etc)
function hook_arrange(screen)
local layout = awful.layout.get(screen)
if layout then
mylayoutbox[screen].text =
"<bg image=\"/usr/share/awesome/icons/layouts/" .. awful.layout.get(screen) .. "w.png\" resize=\"true\"/>"
else
mylayoutbox[screen].text = "No layout."
end
-- If no window has focus, give focus to the latest in history
if not client.focus then
local c = awful.client.focus.history.get(screen, 0)
if c then client.focus = c end
end
-- Uncomment if you want mouse warping
local sel = client.focus
if sel then
local c_c = sel:coords()
local m_c = mouse.coords()
if m_c.x < c_c.x or m_c.x >= c_c.x + c_c.width or
m_c.y < c_c.y or m_c.y >= c_c.y + c_c.height then
if table.maxn(m_c.buttons) == 0 then
mouse.coords({ x = c_c.x + 5, y = c_c.y + 5})
end
end
end
end
-- Hook called every second
function hook_timer ()
-- For unix time_t lovers
-- mytextbox.text = " " .. os.time() .. " time_t "
-- Otherwise use:
mytextbox.text = " " .. os.date() .. " "
end
-- Custom functions
local function get_bat()
local a = io.open("/sys/class/power_supply/BAT0/energy_full")
for line in a:lines() do
full = line
end
a:close()
local b = io.open("/sys/class/power_supply/BAT0/energy_now")
for line in b:lines() do
now = line
end
b:close()
batt=math.floor(now*100/full)
mybatterymonitor:bar_data_add("bat",batt)
end
-- Set up some hooks
awful.hooks.focus.register(hook_focus)
awful.hooks.unfocus.register(hook_unfocus)
awful.hooks.marked.register(hook_marked)
awful.hooks.unmarked.register(hook_unmarked)
awful.hooks.manage.register(hook_manage)
awful.hooks.mouseover.register(hook_mouseover)
awful.hooks.arrange.register(hook_arrange)
awful.hooks.timer.register(1, hook_timer)
awful.hooks.timer.register(5, get_bat)
--startup scriptSame problem here. Also happens to me in wmii. I think if the WM puts the window in floating mode without telling it where to appear somethings will appear wrong.
For me it's the Firefox Upload selection box.
It doesn't happen in ratpoison, but you can tell the floating window is getting moved after it spawns. (ratpoison has editable rules for where to put these windows)
Last edited by Procyon (2008-11-07 22:34:40) -
Unix command to click button on dialog box and close windows?
I administer an elementary school computer lab of 35 eMacs all with OS 10.4.7 and with ARD 3.0. Our network server configuration requires a mounted server on each desktop in order to administer certain software packages we use. Every morning at start-up I have to walk around and manually click "Connect" on the dialog boxes. Then, with this configuration, each time a server is mounted, it opens up a Finder Window on the host machine so I've got to walk around and close windows on all the machines. I'm sure there must be an AppleScript or Unix command that I can set up to do these two tasks but I've not found it (or learned how to write it) in a few days of searching. Any suggestions?
Thanks,
DanOK guys,
I just succeeded in saving the AppleScript command as an application. I put it in the Login Items just after the servers. It worked beautifully! No more open windows exposing sensitive files to the risks of elementary students (how come the mounted volumes always appear on the desktop even when the "hide" button is checked?). It would be great if the mounted volumes were not showing at least in a setting like a school computer lab.
Now, I'm still dealing with the mounting process requiring me to manually click on "Connect" every time. The Student account doesn't even have a password just to make such things easier. Still the process displays this:
(Oh well, I guess I can't insert a ScreenShot.)
Here's what it says: Connect to the file server "server name."
Connect as: Registered User
Name: "account name"
√Remember password in keychain
(and then two buttons) Cancel or Connect
That's where I'm at right now. My district Tech. Support folks say that there's no way to avoid the dialog box but John seems to do it OK. They also pointed me to an online source (www.bombich.com) that I haven't yet checked out.
Thanks again,
Dan -
Adobe X no print dialog box and program closes when printing
Have one user who started encountering this problem today:
Opens up PDF
Clicks on the Print icon (or File - Print)
The Print Dialog box never appears
Adobe 10.1.1 program then immediately closes - nothing in the event log
Able to get the PDF to print only if right clicking on the file and selecting Print (but don't get to select any Printing options)
Have tried selecting a different printer with the same results
Have uninstalled and reinstalled the program
Any help is appreciatediammrbojangles wrote:
I have a similar problem with the the same printer. Excel works fine until you ask to print preview, this takes about a minute to appear, and about another minute if you ask it to print too. Once you've printed and are back in Excel anything you try to do now has a delay. I've tried then changing the printer i want to use to a networked one which makes Excel return to it's normal self.
I've also tried sharing this printer to make sure it wasn't the PC but it is the same on any I've tried.
Maybe you are looking for
-
My iPod classic tries to sync evertime I add any music to it
I recently bought a new iPod classic 80 Gb. I have managed to transfer all the music I had on my old one to the new one but this took a while so I am reluctent to restore unless I have to. But that all worked fine. I am set up to update manually, not
-
Uploaded Yosemite and can't open iTunes
Installed Yosemite and updated iTunes. Now iTunes will not open. Cannot access library or store.
-
Song info now showing up in BMW
I just bought a 2007 BMW 328i with the factory USB iPod connector. When I hook up my 5th generation iPod, the car reads the iPod fine, but on the car console all the songs are displayed as random text and are all under various folders named "f01", "f
-
How do I fix this account issue on itunes?????
I need to open a new itunes account since my old account is shared with my ex-husband and I can no longer access our library without his password. When I attempt to open a new account, my laptop links me to the old one. I just want to open a new acc
-
Invalid Column name during export
When a FULL or USER level export is taken after the export is completed the following error appears. ORA-00904 Invalid Column name When I take table level export it complets successfully. I had run catalog.sql, catproc.sql and catexp.sql. Mohan null