JMenuBar Overlapping
I have a JDesktop which holds a JMenuBar at the top and various JInternalFrames. But if you drag an internal frame up toward the top of the Desktop, the top of the frame(the part you need to click in order to drag the frame) slides underneath the JMenuBar and you can no longer move that internalFrame. Can I set 'layers' somehow to prevent this or any ideas?
Add the menuBar to the JFrame using setJMenuBar(...) method.
Similar Messages
-
MDI JTable Overlap Area Repaint Problem
Hi all,
I have a problem for my application in MDI mode.
I open many windows (JInternalFrame contain JTable) under JDesktopPane. Some of the windows are overlapping and when they receive update in the table, it seems repaint all of the overlapping windows, not only itself. This make my application performance become poor, slow respond for drap & drop an existing window or open a new window.
To prove this, i make a simple example for open many simple table and have a thread to update the table's value for every 200 mill second. After i open about 20 windows, the performance become poor again.
If anyone face the same problem with me and any suggestions to solve the problem ?
Please help !!!!!
Following are my sources:
public class TestMDI extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel contentPanel;
private JDesktopPane desktopPane;
private JMenuBar menuBar;
private List<TestPanel> allScreens = new ArrayList<TestPanel>();
private List<JDialog> freeFloatDialogs = new ArrayList<JDialog>();
private List<JInternalFrame> mdiInternalFrm = new ArrayList<JInternalFrame>();
int x = 0;
int y = 0;
int index = 0;
private static int MDI_MODE = 0;
private static int FREE_FLOAT_MODE = 1;
private int windowMode = MDI_MODE;
public TestMDI() {
init();
public static void main(String[] args) {
new TestMDI().show();
public void init() {
contentPanel = new JPanel();
desktopPane = new JDesktopPane();
desktopPane.setDragMode(JDesktopPane.LIVE_DRAG_MODE);
desktopPane.setFocusTraversalKeysEnabled(false);
desktopPane.setFocusTraversalPolicyProvider(false);
desktopPane.setBorder(null);
desktopPane.setIgnoreRepaint(true);
desktopPane.setPreferredSize(new Dimension(1000, 800));
this.setSize(new Dimension(1000, 800));
menuBar = new JMenuBar();
JMenu menu1 = new JMenu("Test");
JMenuItem menuItem1 = new JMenuItem("Open Lable Screen");
menuItem1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
for (int i = 1; i < 4; i++) {
final TestJLableScreen screen = new TestJLableScreen("Screen " + (allScreens.size() + 1));
screen.startTime();
if (windowMode == MDI_MODE) {
JInternalFrame frame = createInternalFram(screen);
desktopPane.add(frame);
mdiInternalFrm.add(frame);
if (allScreens.size() * 60 + 100 < 1000) {
x = allScreens.size() * 60;
y = 60;
} else {
x = 60 * index;
y = 120;
index++;
frame.setLocation(x, y);
frame.setVisible(true);
} else {
JDialog dialog = createJDialog(screen);
freeFloatDialogs.add(dialog);
if (i * 60 + 100 < 1000) {
x = i * 60;
y = 60;
} else {
x = 60 * index;
y = 120;
index++;
dialog.setLocation(x, y);
dialog.setVisible(true);
allScreens.add(screen);
JMenuItem menuItem2 = new JMenuItem("Open Table Screen");
menuItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
for (int i = 1; i < 4; i++) {
TestTableScreen screen = new TestTableScreen("Screen " + (allScreens.size() + 1));
screen.startTime();
if (windowMode == MDI_MODE) {
JInternalFrame frame = createInternalFram(screen);
desktopPane.add(frame);
mdiInternalFrm.add(frame);
if (allScreens.size() * 60 + 100 < 1000) {
x = allScreens.size() * 60;
y = 60;
} else {
x = 60 * index;
y = 120;
index++;
frame.setLocation(x, y);
frame.setVisible(true);
} else {
JDialog dialog = createJDialog(screen);
freeFloatDialogs.add(dialog);
if (i * 60 + 100 < 1000) {
x = i * 60;
y = 60;
} else {
x = 60 * index;
y = 120;
index++;
dialog.setLocation(x, y);
dialog.setVisible(true);
allScreens.add(screen);
menu1.add(menuItem1);
menu1.add(menuItem2);
this.setJMenuBar(menuBar);
this.getJMenuBar().add(menu1);
this.getJMenuBar().add(createSwitchMenu());
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.add(desktopPane);
desktopPane.setDesktopManager(null);
public JInternalFrame createInternalFram(final TestPanel panel) {
final CustomeInternalFrame internalFrame = new CustomeInternalFrame(panel.getTitle(), true, true, true, true) {
public void doDefaultCloseAction() {
super.doDefaultCloseAction();
allScreens.remove(panel);
internalFrame.setPanel(panel);
// internalFrame.setOpaque(false);
internalFrame.setSize(new Dimension(1010, 445));
internalFrame.add(panel);
internalFrame.setFocusTraversalKeysEnabled(false);
internalFrame.setFocusTraversalPolicyProvider(false);
desktopPane.getDesktopManager();
// internalFrame.setFocusTraversalKeysEnabled(false);
internalFrame.setIgnoreRepaint(true);
return internalFrame;
public JDialog createJDialog(final TestPanel panel) {
JDialog dialog = new JDialog(this, panel.getTitle());
dialog.setSize(new Dimension(1010, 445));
dialog.add(panel);
dialog.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
allScreens.remove(panel);
return dialog;
public JMenu createSwitchMenu() {
JMenu menu = new JMenu("Test2");
JMenuItem menuItem1 = new JMenuItem("Switch FreeFloat");
menuItem1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowMode = FREE_FLOAT_MODE;
for (JInternalFrame frm : mdiInternalFrm) {
frm.setVisible(false);
frm.dispose();
frm = null;
mdiInternalFrm.clear();
remove(desktopPane);
desktopPane.removeAll();
// revalidate();
repaint();
add(contentPanel);
index = 0;
for (JDialog dialog : freeFloatDialogs) {
dialog.setVisible(false);
dialog.dispose();
dialog = null;
freeFloatDialogs.clear();
for (int i = 0; i < allScreens.size(); i++) {
JDialog dialog = createJDialog(allScreens.get(i));
freeFloatDialogs.add(dialog);
if (i * 60 + 100 < 1000) {
x = i * 60;
y = 60;
} else {
x = 60 * index;
y = 120;
index++;
dialog.setLocation(x, y);
dialog.setVisible(true);
JMenuItem menuItem2 = new JMenuItem("Switch MDI");
menuItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowMode = MDI_MODE;
remove(contentPanel);
add(desktopPane);
for (int i = 0; i < freeFloatDialogs.size(); i++) {
freeFloatDialogs.get(i).setVisible(false);
freeFloatDialogs.get(i).dispose();
freeFloatDialogs.clear();
// revalidate();
repaint();
for (JInternalFrame frm : mdiInternalFrm) {
frm.setVisible(false);
frm.dispose();
frm = null;
mdiInternalFrm.clear();
index = 0;
for (int i = 0; i < allScreens.size(); i++) {
JInternalFrame frame = createInternalFram(allScreens.get(i));
desktopPane.add(frame);
mdiInternalFrm.add(frame);
if (i * 60 + 100 < 1000) {
x = i * 60;
y = 60;
} else {
x = 60 * index;
y = 120;
index++;
frame.setLocation(x, y);
frame.setVisible(true);
menu.add(menuItem1);
menu.add(menuItem2);
return menu;
public class TestTableScreen extends TestPanel {
private static final long serialVersionUID = 1L;
JTable testTable = new JTable();
MyTableModel tableModel1 = new MyTableModel(1);
private boolean notRepaint = false;
int start = 0;
JScrollPane scrollPane = new JScrollPane();
private Timer timmer = new Timer(200, new ActionListener() {
public void actionPerformed(ActionEvent e) {
Random indexRandom = new Random();
final int index = indexRandom.nextInt(50);
Random valRandom = new Random();
final int val = valRandom.nextInt(600);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
notRepaint = false;
TestTableScreen.this.update(index + "|" + val);
public TestTableScreen(String title) {
this.title = title;
init();
tableModel1.setTabelName(title);
public void startTime() {
timmer.start();
public String getTitle() {
return title;
public void update(String updateStr) {
String[] val = updateStr.split("\\|");
if (val.length == 2) {
int index = Integer.valueOf(val[0]);
List vals = tableModel1.getVector();
if (vals.size() > index) {
vals.set(index, val[1]);
// tableModel1.fireTableRowsUpdated(index, index);
} else {
vals.add(val[1]);
// tableModel1.fireTableRowsUpdated(vals.size() - 1, vals.size() - 1);
tableModel1.fireTableDataChanged();
public TableModel getTableModel() {
return tableModel1;
public void init() {
testTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
testTable.setRowSelectionAllowed(true);
this.testTable.setModel(tableModel1);
int[] width = { 160, 80, 45, 98, 60, 88, 87, 88, 80, 70, 88, 80, 75, 87, 87, 41, 88, 82, 75, 68, 69 };
TableColumnModel columnModel = testTable.getColumnModel();
for (int i = 0; i < width.length; i++) {
columnModel.getColumn(i).setPreferredWidth(width[i]);
testTable.setRowHeight(20);
tableModel1.fireTableDataChanged();
this.setLayout(new BorderLayout());
TableColumnModel columnMode2 = testTable.getColumnModel();
int[] width2 = { 200 };
for (int i = 0; i < width2.length; i++) {
columnMode2.getColumn(i).setPreferredWidth(width2[i]);
scrollPane.getViewport().add(testTable);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
this.add(scrollPane, BorderLayout.CENTER);
class MyTableModel extends DefaultTableModel {
public List list = new ArrayList();
String titles[] = new String[] { "袨怓1", "袨怓2", "袨怓3", "袨怓4", "袨怓5", "袨怓6", "袨怓7", "袨怓8", "袨怓9", "袨怓10", "袨怓11",
"袨怓12", "袨怓13", "袨怓14", "袨怓15", "袨怓16", "袨怓17", "袨怓18", "袨怓19", "袨怓20", "袨怓21" };
String tabelName = "";
int type_head = 0;
int type_data = 1;
int type = 1;
public MyTableModel(int type) {
super();
this.type = type;
for (int i = 0; i < 50; i++) {
list.add(i);
public void setTabelName(String name) {
this.tabelName = name;
public int getRowCount() {
if (list != null) {
return list.size();
return 0;
public List getVector() {
return list;
public int getColumnCount() {
if (type == 0) {
return 1;
} else {
return titles.length;
public String getColumnName(int c) {
if (type == 0) {
return "head";
} else {
return titles[c];
public boolean isCellEditable(int nRow, int nCol) {
return false;
public Object getValueAt(int r, int c) {
if (list.size() == 0) {
return null;
switch (c) {
default:
if (type == 0) {
return r + " " + c + " test ";
} else {
return list.get(r) + " " + c;
public boolean isNotRepaint() {
return notRepaint;
public void setNotRepaint(boolean notRepaint) {
this.notRepaint = notRepaint;
public class TestPanel extends JPanel {
protected String title = "";
protected boolean needRepaint = false;
protected boolean isFirstOpen = true;
public String getTitle() {
return title;
public void setNeedRepaint(boolean flag) {
this.needRepaint = flag;
public boolean isNeedRepaint() {
return needRepaint;
public boolean isFirstOpen() {
return isFirstOpen;
public void setFirstOpen(boolean isFirstOpen) {
this.isFirstOpen = isFirstOpen;
public class TestJLableScreen extends TestPanel {
private static final long serialVersionUID = 1L;
private JLabel[] allLables = new JLabel[20];
private Timer timmer = new Timer(20, new ActionListener() {
public void actionPerformed(ActionEvent e) {
Random indexRandom = new Random();
final int index = indexRandom.nextInt(10);
Random valRandom = new Random();
final int val = valRandom.nextInt(600);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
TestJLableScreen.this.setNeedRepaint(true);
TestJLableScreen.this.update(index + "|" + val);
public TestJLableScreen(String title) {
this.title = title;
init();
public void startTime() {
timmer.start();
public String getTitle() {
return title;
public void update(String updateStr) {
String[] val = updateStr.split("\\|");
if (val.length == 2) {
int index = Integer.valueOf(val[0]);
allLables[index * 2 + 1].setText(val[1]);
public void init() {
this.setLayout(new GridLayout(10, 2));
boolean flag = true;
for (int i = 0; i < allLables.length; i++) {
allLables[i] = new JLabel() {
// public void setText(String text) {
// super.setText(text);
// // System.out.println(" setText " + getTitle() + " ; " + this.getName());
public void paint(Graphics g) {
super.paint(g);
// System.out.println(" paint " + getTitle() + " ; " + this.getName());
// public void repaint() {
// super.repaint();
// System.out.println(" repaint " + getTitle() + " ; " + this.getName());
allLables[i].setName("" + i);
if (i % 2 == 0) {
allLables[i].setText("Name " + i + " : ");
} else {
allLables[i].setOpaque(true);
if (flag) {
allLables[i].setBackground(Color.YELLOW);
flag = false;
} else {
allLables[i].setBackground(Color.CYAN);
flag = true;
allLables[i].setText(i * 8 + "");
for (int i = 0; i < allLables.length; i++) {
this.add(allLables[i]);
public class CustomeInternalFrame extends JInternalFrame {
protected TestPanel panel;
public CustomeInternalFrame() {
this("", false, false, false, false);
public CustomeInternalFrame(String title) {
this(title, false, false, false, false);
public CustomeInternalFrame(String title, boolean resizable) {
this(title, resizable, false, false, false);
public CustomeInternalFrame(String title, boolean resizable, boolean closable) {
this(title, resizable, closable, false, false);
public CustomeInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable) {
this(title, resizable, closable, maximizable, false);
public CustomeInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable,
boolean iconifiable) {
super(title, resizable, closable, maximizable, iconifiable);
public TestPanel getPanel() {
return panel;
public void setPanel(TestPanel panel) {
this.panel = panel;i had the same problem with buttons and it seemed that i overlayed my button with something else...
so check that out first do you put something on that excact place???
other problem i had was the VAJ one --> VisualAge for Java (terrible program)
it does strange tricks even when you don't use the drawing tool...
dunno 2 thoughts i had... check it out...
SeJo -
Components overlapping problem
Hi,
i have two JPanel's.
first panel is having a MenuBar, it has two menu, say File, Edit.
'File' menu has dropdown menu.
second panel is having two buttons.
very briefly I put above explaination in below code:
menuBar.add(fileMenu);
menuBar.add(editMenu);
menuBar1.add(new Button("first"));
menuBar1.add(new Button("Second"));
menuPanel.add(menuBar);
menuPanel1.add(menuBar1);
menuPanel2.add(menuPanel,BorderLayout.NORTH);
menuPanel2.add(menuPanel1,BorderLayout.SOUTH);
contentPane.add(menuPanel2,BorderLayout.NORTH); //contentPane is Container
frame.getContentPane().add(contentPane);
My problem is when i click File menu, the drop down menu is going back of 'first' button.
i.e., 'first' button is overlapping the drop down menu. I am unable to see the first line of drop down menu.
How to overcome this problem ???
plz help.below is my snippet, i belive i am not using AWT, except for layouts:
import java.awt.*;
import javax.swing.tree.*;
import javax.swing.*;
import java.io.*;
import java.util.*;
import javax.swing.event.*;
public class MainFrame extends JFrame
public MainFrame() {
initComponents();
private void initComponents() {
root = new DefaultMutableTreeNode("Root");
f=new JFrame();
menuPanel = new JPanel();
menuPanel1 = new JPanel();
menuPanel2 = new JPanel();
splitPane1 = new JSplitPane();
panel1 = new JPanel();
panel2 = new JPanel();
//tree_data_display();
//======== this ========
contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
//======== menuPanel ========
menuPanel.setLayout(new BorderLayout());
menuPanel1.setLayout(new BorderLayout());
menuPanel2.setLayout(new BorderLayout());
menuBar = new JMenuBar();
menuBar1 = new JMenuBar();
//Build the first menu.
fileMenu = new JMenu("File");
menuBar.add(fileMenu);
categoriesMenu = new JMenu("Categories");
fileMenu.add(categoriesMenu);
//a group of JMenuItems
categoriesMenuItem1 = new JMenuItem("Add Queue Manager");
categoriesMenu.add(categoriesMenuItem1);
queueMenuItem = new JMenuItem("Queues");
fileMenu.add(queueMenuItem);
//fileMenu.add(exitMenuItem);
//Build second menu in the menu bar.
editMenu = new JMenu("Edit");
menuBar.add(fileMenu);
menuBar.add(editMenu);
menuBar1.add(new Button("FIRST"));
menuBar1.add(new Button("Second"));
menuPanel.add(menuBar);
menuPanel1.add(menuBar1);
menuPanel2.add(menuPanel,BorderLayout.NORTH);
menuPanel2.add(menuPanel1,BorderLayout.SOUTH);
contentPane.add(menuPanel2,BorderLayout.NORTH);
panel2.setLayout(new BorderLayout());
splitPane1.setRightComponent(panel2);
contentPane.add(splitPane1);
f.setTitle ("WMQ Sample");
f.getContentPane().setLayout(new BorderLayout());
f.setSize(700,550);
f.getContentPane().add(contentPane);
f.setVisible(true);
public static void main (String args[]) throws Exception
try{UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());}
catch (Exception e){System.err.println("Couldn't use system look and feel.");}
new MainFrame ();
DefaultMutableTreeNode root;
DefaultTreeModel treeModel;
private JPanel menuPanel1,menuPanel.menuPanel2,panel1,panel2;
private JSplitPane splitPane1;
private JScrollPane scrollPane1,scrollPane2;
private JTree tree;
public JFrame f;
public JMenuBar menuBar,menuBar1;
public JMenu fileMenu,editMenu,viewMenu,toolMenu,menu, submenu,categoriesMenu;
public JMenuItem menuItem,queueMenuItem,categoriesMenuItem1;
public Container contentPane;
Message was edited by:
rkrgarlapati
Message was edited by:
rkrgarlapati -
Painting, overlapping and hiding
Hi, guys
I want to write a graphic editor, just like Paint of windows.
JFrame frame : the main frame
JPanel panelWest: the tool bar in the west
JPanel panelNorth: the tool bar in the north
JPanel panelCenter: the main edit panel
JMenuBar menuBar:
and add all the stuff into frame. I did not overwrite the paint() methods for frame, panelNorth,panelWest. On the other hand, I overwrite the paint() for panelCenter, letting it draw something.
Here is the problem: when i draw something in the panelCenter, the other component like menuBar, panelNorth and panelWest will be on the panelCenter. that is there are two menuBar, two panelNorth and tow panelWest.
I tried another way: I use Canvas instead of panelCenter, and the problem above is solved. But another problem rises: the canvas will be on the top of the other components, i.e., when click menu, the menuitems that overlaps with the canvas will be invisible.
Thanks!import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GUI extends JFrame{
public GUI(){
Container c=getContentPane();
JPanel panelWest=new JPanel();
JPanel panelNorth=new JPanel();
MyPanel panelCenter=new MyPanel();
JMenuBar mb=new JMenuBar();
JMenu m1=new JMenu("File");
JMenu m2=new JMenu("Edit");
JMenu m3=new JMenu("Help");
m1.add(new JMenuItem("Opne"));
m1.add(new JMenuItem("Save"));
m1.add(new JMenuItem("Print"));
m1.add(new JMenuItem("Close"));
m2.add(new JMenuItem("Copy"));
m2.add(new JMenuItem("Paste"));
m2.add(new JMenuItem("Cut"));
m2.add(new JMenuItem("Delete"));
m3.add(new JMenuItem("Help Content"));
m3.add(new JMenuItem("About"));
mb.add(m1);
mb.add(m2);
mb.add(m3);
setJMenuBar(mb);
panelWest.add(new JButton("B1"));
panelNorth.add(new JButton("B2"));
c.add(panelWest,"West");
c.add(panelNorth,"North");
c.add(panelCenter,"Center");
setSize(300,200);
show();
public static void main(String args[]){
new GUI();
class MyPanel extends JPanel{
int x;
int y;
public MyPanel(){
setBackground(Color.white);
addMouseListener(
new MouseAdapter(){
public void mousePressed(MouseEvent e){
x=e.getX();
y=e.getY();
repaint();
public void paint(Graphics g){
g.drawRect(x,y,30,30);
} -
How can I fix left pane text overlap in iCal Day view?
In "Day" view, the items in the left hand (list) pane in iCal are overlapping, obscuring the bottom 1/3 of each line of text. It is as if the table cells are too close together vertically. How do I fix this?
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
*Don't make any changes on the Safe mode start window.
*https://support.mozilla.org/kb/Safe+Mode
Try to disable hardware acceleration.
*Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
If disabling hardware acceleration works then check if there is an update available for your graphics display driver. -
Can i call a JMenuBar in a number of JFrame(s) ?
Hi ,
I've a program with a number of JFrames.
I wanted to add a JMenuBar for each frame of my program, this menu bar has the same design code and the same events code in all the program frames, so is there a way to create this JMenuBar once only & call it some how in every JFrame to load it directly instead of writing its same code a lot of times for every JFrame ?
Thanks ,
Heshamimport java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
class Test{
public static void main( String[] argv ) throws Throwable {
for(int i=0; i<10; i++){
SuperFrame f = new SuperFrame();
f.setLocation(i*10,i*10);
f.setSize(400,300);
f.setVisible(true);
class SuperFrame extends JFrame{
private static final long serialVersionUID = 1L;
* All the menu item goes here
JMenuBar mbar = new JMenuBar();
JMenu menu = new JMenu("Menu");
JMenuItem menuItem1 = new JMenuItem("Close");
JMenuItem menuItem2 = new JMenuItem("Exit");
public SuperFrame(){
super("Testing");
this.menu.add(menuItem1);
this.menu.add(menuItem2);
this.mbar.add(menu);
this.setJMenuBar(mbar);
menuItem1.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent arg0) {
dispose();
menuItem2.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent arg0) {
System.exit(0);
} -
Overlap, bookmarker or something like this...
hi,
i read a lot of ebooks and i've got this question:
can i mark a overlap or bookmarker (just like in normal books) in adobe so when i close ebook it will open next time exactly where i finished reading recently?
i'm new so sorry if this thread repeats...Look here:
http://forums.adobe.com/message/3321356#3321356 -
Awesome systray is not showing all icons, perhaps overlapping widgets?
I have a problem with my Awesome configuration that results in some of the icons being missing or partially missing from my systray. I suspect this is because of some overlapping, since they are partially hidden. You can see the problem in the top right corner.
rc.lua:
-- Standard awesome library
require("awful")
require("awful.autofocus")
require("awful.rules")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")
--Wiget Library
require("vicious")
-- awesoMPD Widget
--require("awesompd/awesompd")
-- {{{ Variable definitions
-- Themes define colours, icons, and wallpapers
beautiful.init("/usr/share/awesome/themes/blind-alien/theme.lua")
-- This is used later as the default terminal and editor to run.
terminal = "urxvt"
editor = os.getenv("EDITOR") or "vim"
editor_cmd = terminal .. " -e " .. editor
-- Enable or disable widgets:
-- You also have to edit the wiboxes!
useSysInfo = true
usePacman = true
useMpd = true
useWifi = false
useNet = true
useBat = false
useCpu = true
useMem = true
useTemp = false
-- Widget Settings
cpuCores = 2 --Number of CPU Cores
thermalZone = "coretemp.0" --Thermal Zone to read cpu temperature from (check vicious docu)
thermalData = "core" --Data Source: "proc", "core" or "sys"
netAdapter = "eth0" --Network adapter to monitor
wifiAdapter = "wlan0" --Wifi adapter for wifi widget
pacUpdate = "yaourt -Sy" --Command to update pacman cache
pacUpgrade = "yaourt -Su" --Command to upgrade system
networkManager = terminal .. " -e wicd-curses"
battery = "BAT1" --Battery to monitor
widthMpd = 420 --Width of MPD widget
-- Widget update intervals in seconds
updateCpu = 1
updatePac = 1801
updateMpd = 1
updateWifi = 7
updateNet = 1
updateBat = 31
updateMem = 7
-- For Dual-Screen setups:
-- Set "dualScreen" to "2" if you want a different, optimized widget layout for every screen.
-- If you set it to "-1" it will copy the same widget layout to both screens. (default Awesome behavior)
dualScreen = -1
screencount = screen.count()
-- 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 =
awful.layout.suit.tile,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
awful.layout.suit.fair,
awful.layout.suit.fair.horizontal,
awful.layout.suit.magnifier,
awful.layout.suit.floating,
awful.layout.suit.max
-- {{{ Tags
-- Define a tag table which will hold all screen tags.
tags = {
--names = { "1", "2", "3", "4", "5", "6"},
--names = { "⌘", "♐", "⌥", "ℵ"},
--names = { "⠪", "⠫", "⠬", "⠭", "⠮", "⠳"},
names = { "⠐", "⠡", "⠪", "⠵", "⠻", "⠿" },
--names = { " ∙", "⠡", "⠲", "⠵", "⠻", "⠿"},
--names = { " ⠐ ", " ⠡ ", " ⠲ ", " ⠵ ", " ⠾ ", " ⠿ "},
--names = { "⢷", "⣨", "⡪", "⣌", "⣪", "⡝"},
layout = {
layouts[8], layouts[8], layouts[8], layouts[5], layouts[8], layouts[8]
for s = 1, screencount do
tags[s] = awful.tag(tags.names, s, tags.layout)
end
-- {{{ Menu
-- Create a laucher widget and a main menu
myawesomemenu = {
{ "manual", terminal .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
{ "restart WM", awesome.restart },
{ "logout", awesome.quit },
{ "shutdown" , "sudo /sbin/halt -p" },
{ "reboot" , "sudo /sbin/reboot" }
myinternet = {
{ "Chromium", "chromium" },
{ "Firefox" , "firefox" },
{ "IM" , "pidgin" },
{ "IRC" , "xchat"}
mymedia = {
{ "Spotify", "spotify" },
{ "Rhythmbox", "rhythmbox" },
{ "ncmpcpp", "urxvt -e ncmpcpp" },
{ "Gnome Mplayer", "gnome-mplayer" },
{ "VLC" , "vlc" }
mygraphics = {
{ "GIMP" , "gimp" },
{ "Inkscape" , "inkscape" },
{ "Image viewer" , "eog" }
myoffice = {
{ "Base" , "lobase" },
{ "Calc" , "localc" },
{ "Impress" , "loimpress" },
{ "LibreOffice" , "loffice" },
{ "Writer" , "lowriter" },
{ "Lyx" , "lyx" },
{ "Document viewer" , "evince" }
mysystem = {
{ "htop" , "urxvt -e htop" },
{ "Partition" , "gksudo gparted" },
{ "Sys mon" , "gnome-system-monitor" }
myutilities = {
{ "Gedit" , "gedit" },
{ "Virtualbox" , "VirtualBox" },
{ "File Manager" , "nautilus --no-desktop" }
myplaces = {
{ "Home" , "nautilus --no-desktop /home/johan/" },
{ "Documents" , "nautilus --no-desktop /home/johan/Documents/" },
{ "Downloads" , "nautilus --no-desktop /home/johan/Downloads/" },
{ "Music" , "nautilus --no-desktop /home/johan/Music/" },
{ "Pictures" , "nautilus --no-desktop /home/johan/Pictures/" }
myserverplaces = {
{ "Server root" , "nautilus --no-desktop /srv/" },
{ "Downloads" , "nautilus --no-desktop /srv/download/" },
{ "Movies" , "nautilus --no-desktop /srv/movies/" },
{ "Tv-Series" , "nautilus --no-desktop /srv/tv-series/" },
{ "Misc" , "nautilus --no-desktop /srv/misc/" }
mymainmenu = awful.menu({ items = {
{ "Terminal", terminal },
{ "Places" , myplaces },
{ "Server" , myserverplaces },
{ "Internet" , myinternet },
{ "Media" , mymedia },
{ "Graphics" , mygraphics },
{ "Office" , myoffice },
{ "Utilities" , myutilities },
{ "Systools" , mysystem },
{ "Awesome", myawesomemenu }
mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
menu = mymainmenu })
-- Separators
bubble = widget({ type = "textbox" })
spacer = widget({ type = "textbox" })
space = widget({ type = "textbox" })
separator = widget({ type = "textbox" })
bracketl = widget({ type = "textbox" })
bracketr = widget({ type = "textbox" })
vertline = widget({ type = "textbox" })
dash = widget({ type = "textbox" })
bubble.text = " ∘ "
spacer.text = " "
space.text = " "
--separator.text = "<span font_desc='ClearlyU'> ⡾ </span>"
separator.text = "] ["
vertline.text = "|"
dash.text = "-"
bracketl.text = "["
bracketr.text = "]"
-- Status Labels
cpuLabel = {}
for s = 1, cpuCores do
cpuLabel[s] = widget({ type = "textbox" })
cpuLabel[s].text = "Core " .. s
end
rlabel = widget({ type = "textbox" })
rlabel.text = "Root:"
hlabel = widget({ type = "textbox" })
hlabel.text = "Home:"
-- WIDGETS --
-- OS info
if useSysInfo == true then
sys = widget({ type = "textbox" })
vicious.register(sys, vicious.widgets.os, "$1 $2")
end
-- Pacman updates
if usePacman == true then
-- Widget
pnoghosticon = widget({ type = "imagebox" })
pnoghosticon.image = image(beautiful.widget_pacnoghost)
pnoghosticon.visible = true
pghosticon = awful.widget.launcher({
image = beautiful.widget_pacghost,
command = terminal .. " -e " .. pacUpgrade .. " && echo -e 'vicious.force({ pacup, })' | awesome-client"
pghosticon.visible = false
-- Icon
-- picon = widget({ type = "imagebox" })
-- picon.image = image(beautiful.widget_pacnew)
-- Use the Pacman icon as launcher to update the package list (change to fit your package-management system)
picon = awful.widget.launcher({
image = beautiful.widget_pacnew,
command = pacUpdate .. " && echo -e 'vicious.force({ pacup, })' | awesome-client"
runpicon = awful.widget.launcher({
image = beautiful.widget_pacman_run,
command = pacUpdate .. " && echo -e 'vicious.force({ pacup, })' | awesome-client"
runpicon.visible = false
pacup = widget({ type = "textbox" })
vicious.register(pacup, vicious.widgets.pkg,
function(widget, args)
local nr = tonumber(args[1])
if nr ~= 0 then
pnoghosticon.visible = false
pghosticon.visible = true
picon.visible = false
runpicon.visible = true
else
pghosticon.visible = false
pnoghosticon.visible = true
runpicon.visible = false
picon.visible = true
end
end, updatePac, "Arch")
end
-- MPD Widget
if useMpd == true then
-- PLAY, STOP, PREV/NEXT Buttons
-- requires modification of /usr/share/awesome/lib/awful/widget/launcher.lua
-- b = util.table.join(w:buttons(), button({}, 1, nil, function () util.spawn(args.command) end))
-- to:
-- b = util.table.join(w:buttons(), button({}, 1, nil, function () util.spawn_with_shell(args.command) end))
music_play = awful.widget.launcher({
image = beautiful.widget_play,
command = "mpc toggle && echo -e 'vicious.force({ mpdwidget, })' | awesome-client"
music_pause = awful.widget.launcher({
image = beautiful.widget_pause,
command = "mpc toggle && echo -e 'vicious.force({ mpdwidget, })' | awesome-client"
music_pause.visible = false
music_stop = awful.widget.launcher({
image = beautiful.widget_stop,
command = "mpc stop && echo -e 'vicious.force({ mpdwidget, })' | awesome-client"
music_prev = awful.widget.launcher({
image = beautiful.widget_prev,
command = "mpc prev && echo -e 'vicious.force({ mpdwidget, })' | awesome-client"
music_next = awful.widget.launcher({
image = beautiful.widget_next,
command = "mpc next && echo -e 'vicious.force({ mpdwidget, })' | awesome-client"
mpdicon = widget({ type = "imagebox" })
mpdicon.image = image(beautiful.widget_mpd)
-- Initialize widget
mpdwidget = widget({ type = "textbox" })
--mpdwidget.wrap = "none"
mpdwidget.width = widthMpd
--mpdwidget.wrap = "word_char"
-- Register Widget
--vicious.register(mpdwidget, vicious.widgets.mpd, "(${state}) : ${Artist} - ${Title} ]", 13)
-- Set the maximum width of the MPD widget inside the string.format function as "%.<length>s"
vicious.register(mpdwidget, vicious.widgets.mpd,
function(widget, args)
--local maxlength = 85
local font = beautiful.font
local string = args["{Artist}"] .. " - " .. args["{Title}"]
--local string = "[" .. args["{state}"] .. "]" .. " : " .. args["{Artist}"] .. " - " .. args["{Title}"]
--[[ if maxlength < string.len(string) then
return "<span font_desc='" .. font .. "'>" .. string.sub(string, 0, maxlength-6) .. "</span> ..."
else
return "<span font_desc='" .. font .. "'>" .. string .. "</span>"
end]]
if args["{state}"] == "Play" then
music_play.visible = false
music_pause.visible = true
else
music_play.visible = true
music_pause.visible = false
end
return string
end, updateMpd)
end
---- WIFI Widget
--if useWifi == true then
-- wifiwidget = widget({ type = "textbox" })
-- wifiwidget.width = 22
-- wifiwidget.align = "right"
-- --wifiimage = widget({ type = "imagebox" })
-- wifiimage0 = awful.widget.launcher({
-- image = beautiful.widget_wifi0,
-- command = networkManager
-- wifiimage0.image.visible = true
-- wifiimage1 = awful.widget.launcher({
-- image = beautiful.widget_wifi1,
-- command = networkManager
-- wifiimage1.image.visible = false
-- wifiimage2 = awful.widget.launcher({
-- image = beautiful.widget_wifi2,
-- command = networkManager
-- wifiimage2.image.visible = false
-- wifiimage3 = awful.widget.launcher({
-- image = beautiful.widget_wifi3,
-- command = networkManager
-- wifiimage3.image.visible = false
-- wifiimage4 = awful.widget.launcher({
-- image = beautiful.widget_wifi4,
-- command = networkManager
-- wifiimage4.image.visible = false
-- -- Register Widget
-- -- change to the desired network adapter if needed
-- --vicious.register(wifiwidget, vicious.widgets.wifi, "~ ${link}%", 5, "wlan0")
-- vicious.register(wifiwidget, vicious.widgets.wifi,
-- function(widget, args)
-- if tonumber(args["{link}"]) > 75 then
-- wifiimage0.visible = false
-- wifiimage1.visible = false
-- wifiimage2.visible = false
-- wifiimage3.visible = false
-- wifiimage4.visible = true
-- elseif tonumber(args["{link}"]) > 50 then
-- wifiimage0.visible = false
-- wifiimage1.visible = false
-- wifiimage2.visible = false
-- wifiimage3.visible = true
-- wifiimage4.visible = false
-- elseif tonumber(args["{link}"]) > 25 then
-- wifiimage0.visible = false
-- wifiimage1.visible = false
-- wifiimage2.visible = true
-- wifiimage3.visible = false
-- wifiimage4.visible = false
-- elseif tonumber(args["{link}"]) > 0 then
-- wifiimage0.visible = false
-- wifiimage1.visible = true
-- wifiimage2.visible = false
-- wifiimage3.visible = false
-- wifiimage4.visible = false
-- else
-- wifiimage0.visible = true
-- wifiimage1.visible = false
-- wifiimage2.visible = false
-- wifiimage3.visible = false
-- wifiimage4.visible = false
-- end
-- return string.format("%02d%%", tonumber(args["{link}"]))
-- end, updateWifi, wifiAdapter)
--end
-- NETWORK Widget
if useNet == true then
dnicon = widget({ type = "imagebox" })
upicon = widget({ type = "imagebox" })
dnicon.image = image(beautiful.widget_down)
upicon.image = image(beautiful.widget_up)
-- Initialize widget
netdnwidget = widget({ type = "textbox" })
netdnwidget.width = 55
--netdnwidget.align = "right"
netupwidget = widget({ type = "textbox" })
netupwidget.width = 55
--netupwidget.align = "right"
-- Register widget
-- change to the desired network adapter if needed
--vicious.register(netdnwidget, vicious.widgets.net, "${eth0 down_kb} kB/s", 1)
--vicious.register(netupwidget, vicious.widgets.net, "${eth0 up_kb} kB/s", 1)
-- The following code formats the output to fill with zeroes at the beginning i.e. 013 kB/s instead of 13 kB/s.
-- It also automatically switches to MB/s if there is more than 999 kB/s
vicious.register(netdnwidget, vicious.widgets.net,
function(widget, args)
if tonumber(args["{" .. netAdapter .. " down_kb}"]) > 999 then
return string.format("%04.1f MB/s", tonumber(args["{" .. netAdapter .. " down_mb}"]))
else
return string.format("%03d kB/s", tonumber(args["{" .. netAdapter .. " down_kb}"]))
end
end, updateNet)
vicious.register(netupwidget, vicious.widgets.net,
function(widget, args)
if tonumber(args["{" .. netAdapter .. " up_kb}"]) > 999 then
return string.format("%04.1f MB/s", tonumber(args["{" .. netAdapter .. " up_mb}"]))
else
return string.format("%03d kB/s", tonumber(args["{" .. netAdapter .. " up_kb}"]))
end
end, updateNet)
end
---- BATTERY widget
--if useBat == true then
-- baticon = widget({ type = "imagebox" })
-- --baticon.image = image(beautiful.widget_batfull)
-- --Initialize widget
-- batwidget = widget({ type = "textbox" })
-- batwidget.width = 22
-- batwidget.align = "right"
-- --Register widget
-- --vicious.register(batwidget, vicious.widgets.bat, "$1$2", 31, "BAT1")
-- vicious.register(batwidget, vicious.widgets.bat,
-- function(widget, args)
-- if string.match(args[1], "[+↯]") then
-- baticon.image = image(beautiful.widget_ac)
-- elseif tonumber(args[2]) > 40 then
-- baticon.image = image(beautiful.widget_batfull)
-- elseif tonumber(args[2]) > 20 then
-- baticon.image = image(beautiful.widget_batlow)
-- else
-- baticon.image = image(beautiful.widget_batempty)
-- end
-- if tonumber(args[2]) == 100 then
-- return "Full"
-- end
-- return args[2] .. "%"
-- end, updateBat, battery)
--end
-- {{{ CPU
--if useTemp == true then
-- -- Core Temp
-- tempwidget = widget({ type = "textbox" })
-- tempwidget.width = 26
-- tempwidget.align = "right"
-- vicious.register(tempwidget, vicious.widgets.thermal, "$1 C", updateCpu, { thermalZone, thermalData })
-- --vicious.register(tempwidget, vicious.widgets.thermal, "$1°C", 5, { "thermal_zone0", "sys" })
-- -- Icon
-- tempicon = widget({ type = "imagebox" })
-- tempicon.image = image(beautiful.widget_temp)
--end
-- Readout
if useCpu == true then
-- Icon
cpuicon = widget({ type = "imagebox" })
cpuicon.image = image(beautiful.widget_cpu)
-- Core 1 Meter
cpubar = {}
freq = {}
displayCores = {}
displayCpu = {}
for s = 1, cpuCores do
cpubar[s] = awful.widget.progressbar()
cpubar[s]:set_width(50)
cpubar[s]:set_height(6)
cpubar[s]:set_vertical(false)
cpubar[s]:set_background_color("#434343")
--cpubar:set_color(beautiful.fg_normal)
cpubar[s]:set_gradient_colors({ beautiful.fg_normal, beautiful.fg_normal, beautiful.fg_normal, beautiful.bar })
--Delete the following line if you want to put the widget on the left side of the wibox
cpubar[s].layout = awful.widget.layout.horizontal.rightleft
vicious.register(cpubar[s], vicious.widgets.cpu, "$" .. s, updateCpu)
awful.widget.layout.margins[cpubar[s].widget] = { top = 6 }
-- Frequency
freq[s] = widget({ type = "textbox" })
freq[s].width = 44
freq[s].align = "right"
--vicious.register(freq1, vicious.widgets.cpufreq, "$2 GHz", 9, "cpu0")
vicious.register(freq[s], vicious.widgets.cpufreq,
function(widget, args)
return string.format("%03.1f GHz", args[2])
end, updateCpu, "cpu" .. s - 1)
-- Cache that shit
vicious.cache(vicious.widgets.cpu)
end
end
-- }}} CPU
-- {{{ MEM
if useMem == true then
-- Icon
memicon = widget({ type = "imagebox" })
memicon.image = image(beautiful.widget_mem)
-- Percentage
--mem = widget({ type = "textbox" })
--vicious.register(mem, vicious.widgets.mem, "$1%")
-- Meter
membar = awful.widget.progressbar()
membar:set_width(50)
membar:set_height(6)
membar:set_vertical(false)
membar:set_background_color("#434343")
--membar:set_color(beautiful.fg_normal )
membar:set_gradient_colors({ beautiful.fg_normal, beautiful.fg_normal, beautiful.fg_normal, beautiful.bar })
--This bar should be placed on the right side of the wibox unless
--it's a dual-screen config in which case the default (leftright)
--layout is used... change that if you need!
if screencount ~= dualScreen then
membar.layout = awful.widget.layout.horizontal.rightleft
end
--Register the widget
vicious.register(membar, vicious.widgets.mem, "$1", updateMem)
-- Align progressbars
awful.widget.layout.margins[membar.widget] = { top = 6 }
-- MEM Usage
--mem_total = widget({ type = "textbox" })
--vicious.register(mem_total, vicious.widgets.mem, "$3 MB", 9)
--mem_used = widget({ type = "textbox" })
--vicious.register(mem_total, vicious.widgets.mem, "$2 MB", 9,)
-- Cache that shit
vicious.cache(vicious.widgets.mem)
end
-- }}} MEM
-- Create a textclock widget
mytextclock = awful.widget.textclock({ align = "right" }, "%H:%M")
awful.widget.layout.margins[mytextclock] = { top = -1 }
-- Create a systray
mysystray = widget({ type = "systray"})
-- Create a wibox for each screen and add it
mywibox = {}
mybottomwibox = {}
mypromptbox = {}
mylayoutbox = {}
mytaglist = {}
mytaglist.buttons = awful.util.table.join(awful.button({}, 1, awful.tag.viewonly),
awful.button({ modkey }, 1, awful.client.movetotag),
awful.button({}, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, awful.client.toggletag),
awful.button({}, 4, awful.tag.viewnext),
awful.button({}, 5, awful.tag.viewprev))
mytasklist = {}
mytasklist.buttons = awful.util.table.join(awful.button({}, 1, function(c)
if not c:isvisible() then
awful.tag.viewonly(c:tags()[1])
end
client.focus = c
c:raise()
end),
awful.button({}, 3, function()
if instance then
instance:hide()
instance = nil
else
instance = awful.menu.clients({ width = 250 })
end
end),
awful.button({}, 4, function()
awful.client.focus.byidx(1)
if client.focus then client.focus:raise() end
end),
awful.button({}, 5, function()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end))
for s = 1, screencount do
-- Set a screen margin for borders
awful.screen.padding(screen[s], { top = 0 })
-- Create a promptbox for each screen
mypromptbox[s] = awful.widget.prompt()
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.
mylayoutbox[s] = awful.widget.layoutbox(s)
mylayoutbox[s]:buttons(awful.util.table.join(awful.button({}, 1, function() awful.layout.inc(layouts, 1) end),
awful.button({}, 3, function() awful.layout.inc(layouts, -1) end),
awful.button({}, 4, function() awful.layout.inc(layouts, 1) end),
awful.button({}, 5, function() awful.layout.inc(layouts, -1) end)))
mylayoutbox[s].resize = false
-- Create a taglist widget
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons)
awful.widget.layout.margins[mytaglist[s]] = { top = -2 }
-- WARNING: In order to properly view the tasklist some lua files have been modified. For the
-- tasklist_floating_icon icon to be placed on the left side of the task name instead of the
-- right alignment, /usr/share/awesome/lib/awful/widget/tasklist.lua in function new(label, buttons) the
-- variable widgets.textbox has to be modified like this:
-- remove bg_align = "right" and
-- modify the left margin from 2 to icon width + 2 (i.e.: 18).
-- Create a tasklist widget
mytasklist[s] = awful.widget.tasklist(function(c)
return awful.widget.tasklist.label.currenttags(c, s,
-- WARNING: Requires modified /usr/share/awesome/lib/awful/widget/tasklist.lua !!!
-- This basically hides the application icons on the tasklist. If you don't want this or
-- prefer not to change your tasklist.lua remove the following line!
{ hide_icon = true })
end, mytasklist.buttons)
awful.widget.layout.margins[mytasklist[s]] = { top = 2 }
-- WIBOXES --
-- Here we create the wiboxes if it's not a dual-screen layout
if screencount ~= dualScreen then
-- Create the wibox
mywibox[s] = awful.wibox({ position = "top", screen = s, border_width = 0, height = 18 })
-- Add widgets to the wibox - order matters
mywibox[s].widgets = {
mytaglist[s],
mypromptbox[s],
displaySysInfo,
layout = awful.widget.layout.horizontal.leftright
mytextclock,
mylayoutbox[s],
s == 1 and mysystray or nil,
mytasklist[s],
layout = awful.widget.layout.horizontal.rightleft
mybottomwibox[s] = awful.wibox({ position = "bottom", screen = s, border_width = 0, height = 18 })
mybottomwibox[s].widgets = {
space, music_play, music_pause, music_stop, music_prev, music_next, space, mpdwidget,
layout = awful.widget.layout.horizontal.leftright
spacer,
bracketr,
-- spacer, batwidget, spacer, baticon, spacer,
-- separator,
-- spacer, wifiwidget, spacer, wifiimage0, wifiimage1, wifiimage2, wifiimage3, wifiimage4, spacer,
-- separator,
-- spacer, tempwidget, spacer, tempicon, spacer,
-- separator,
spacer, freq[1], spacer, cpubar[1], spacer,
--cpuLabel[1], spacer,
cpuicon, spacer,
separator,
spacer, membar, spacer, memicon, spacer,
separator,
spacer, netupwidget, spacer, upicon, spacer, separator, spacer, netdnwidget, spacer, dnicon, spacer,
separator,
space, pghosticon, pnoghosticon, runpicon, picon, space,
bracketl,
layout = awful.widget.layout.horizontal.rightleft
end
end
if screencount == dualScreen then
-- Here we create the wiboxes if it is a dual screen configuration:
mywibox[1] = awful.wibox({ position = "top", screen = 1, border_width = 0, height = 18 })
-- Add widgets to the wibox - order matters
mywibox[1].widgets = {
mytaglist[1],
spacer,
mypromptbox[1],
mytasklist[1],
layout = awful.widget.layout.horizontal.leftright
spacer,
mytextclock,
-- spacer,
mylayoutbox[1],
-- spacer,
-- mytasklist[1],
layout = awful.widget.layout.horizontal.rightleft
mybottomwibox[1] = awful.wibox({ position = "bottom", screen = 1, border_width = 0, height = 18 })
mybottomwibox[1].widgets = {
space, music_play, music_pause, music_stop, music_prev, music_next, space, mpdwidget,
layout = awful.widget.layout.horizontal.leftright
space,
s == 1 and mysystray or nil,
layout = awful.widget.layout.horizontal.rightleft
mywibox[2] = awful.wibox({ position = "top", screen = 2, border_width = 0, height = 18 })
mywibox[2].widgets = {
space,
mytaglist[2],
spacer,
mypromptbox[2],
layout = awful.widget.layout.horizontal.leftright
spacer,
mytextclock,
space,
mylayoutbox[2],
spacer,
mytasklist[2],
layout = awful.widget.layout.horizontal.rightleft
mybottomwibox[2] = awful.wibox({ position = "bottom", screen = 2, border_width = 0, height = 18 })
mybottomwibox[2].widgets = {
spacer,
bracketl,
spacer, sys, spacer,
separator,
space, runpicon, picon, pghosticon, pnoghosticon, space,
separator,
spacer, dnicon, spacer, netdnwidget, spacer, separator, spacer, upicon, spacer, netupwidget, spacer,
separator,
spacer, memicon, spacer, membar, spacer,
bracketr,
layout = awful.widget.layout.horizontal.leftright
spacer,
bracketr,
spacer, tempwidget, spacer, tempicon, spacer,
separator,
spacer, freq[2], spacer, cpubar[2], spacer,
cpuLabel[2], spacer,
cpuicon, spacer,
separator,
spacer, freq[1], spacer, cpubar[1], spacer,
cpuLabel[1], spacer,
cpuicon, spacer,
bracketl,
layout = awful.widget.layout.horizontal.rightleft
end
-- {{{ Mouse bindings
root.buttons(awful.util.table.join(awful.button({}, 3, function() mymainmenu:toggle() end),
awful.button({}, 4, awful.tag.viewnext),
awful.button({}, 5, awful.tag.viewprev)))
-- {{{ Key bindings
globalkeys = awful.util.table.join(awful.key({ modkey, }, "Left", awful.tag.viewprev),
awful.key({ }, "Print", function () awful.util.spawn("gnome-screenshot") end),
awful.key({ modkey, }, "Right", awful.tag.viewnext),
awful.key({ modkey, }, "Escape", awful.tag.history.restore),
awful.key({ modkey, }, "j",
function()
awful.client.focus.byidx(1)
if client.focus then client.focus:raise() end
end),
awful.key({ modkey, }, "k",
function()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end),
awful.key({ modkey, }, "w", function() mymainmenu:show({ keygrabber = true }) end),
--Volume manipulation
-- awful.key({}, "XF86AudioRaiseVolume", function() awful.util.spawn("amixer set Master 5+") end),
-- awful.key({}, "XF86AudioLowerVolume", function() awful.util.spawn("amixer set Master 5-") end),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function() awful.client.swap.byidx(1) end),
awful.key({ modkey, "Shift" }, "k", function() awful.client.swap.byidx(-1) end),
awful.key({ modkey, "Control" }, "j", function() awful.screen.focus_relative(1) end),
awful.key({ modkey, "Control" }, "k", function() awful.screen.focus_relative(-1) end),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
awful.key({ modkey, }, "Tab",
function()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end),
-- Standard program
awful.key({ modkey, }, "Return", function() awful.util.spawn(terminal) end),
awful.key({ modkey, "Control" }, "r", awesome.restart),
awful.key({ modkey, "Shift" }, "q", awesome.quit),
awful.key({ modkey, }, "l", function() awful.tag.incmwfact(0.05) end),
awful.key({ modkey, }, "h", function() awful.tag.incmwfact(-0.05) end),
awful.key({ modkey, "Shift" }, "h", function() awful.tag.incnmaster(1) end),
awful.key({ modkey, "Shift" }, "l", function() awful.tag.incnmaster(-1) end),
awful.key({ modkey, "Control" }, "h", function() awful.tag.incncol(1) end),
awful.key({ modkey, "Control" }, "l", function() awful.tag.incncol(-1) end),
awful.key({ modkey, }, "space", function() awful.layout.inc(layouts, 1) end),
awful.key({ modkey, "Shift" }, "space", function() awful.layout.inc(layouts, -1) end),
-- Prompt
awful.key({ modkey }, "r", function() mypromptbox[mouse.screen]:run() end),
awful.key({ modkey }, "x",
function()
awful.prompt.run({ prompt = "Run Lua code: " },
mypromptbox[mouse.screen].widget,
awful.util.eval, nil,
awful.util.getdir("cache") .. "/history_eval")
end))
clientkeys = awful.util.table.join(awful.key({ modkey, }, "f", function(c) c.fullscreen = not c.fullscreen end),
awful.key({ modkey, }, "q", function(c) c:kill() end),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle),
awful.key({ modkey, "Control" }, "Return", function(c) c:swap(awful.client.getmaster()) end),
awful.key({ modkey, }, "o", awful.client.movetoscreen),
awful.key({ modkey, "Shift" }, "m", function () awful.util.spawn("urxvt -T ncmpcpp -e 'ncmpcpp'") end),
awful.key({ modkey, "Shift" }, "w", function () awful.util.spawn("chromium") end),
awful.key({ modkey, }, "b", function () awful.util.spawn("nautilus --no-desktop") end),
awful.key({ modkey, "Shift" }, "r", function(c) c:redraw() end),
awful.key({ modkey, }, "t", function(c) c.ontop = not c.ontop end),
awful.key({ modkey, }, "n", function(c) c.minimized = not c.minimized end),
awful.key({ modkey, }, "m",
function(c)
c.maximized_horizontal = not c.maximized_horizontal
c.maximized_vertical = not c.maximized_vertical
end))
-- Compute the maximum number of digit we need, limited to 9
keynumber = 0
for s = 1, screencount do
keynumber = math.min(9, math.max(#tags[s], keynumber));
end
-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it works on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, keynumber do
globalkeys = awful.util.table.join(globalkeys,
awful.key({ modkey }, "#" .. i + 9,
function()
local screen = mouse.screen
if tags[screen][i] then
awful.tag.viewonly(tags[screen][i])
end
end),
awful.key({ modkey, "Control" }, "#" .. i + 9,
function()
local screen = mouse.screen
if tags[screen][i] then
awful.tag.viewtoggle(tags[screen][i])
end
end),
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function()
if client.focus and tags[client.focus.screen][i] then
awful.client.movetotag(tags[client.focus.screen][i])
end
end),
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function()
if client.focus and tags[client.focus.screen][i] then
awful.client.toggletag(tags[client.focus.screen][i])
end
end))
end
clientbuttons = awful.util.table.join(awful.button({}, 1, function(c) client.focus = c; c:raise() end),
awful.button({ modkey }, 1, awful.mouse.client.move),
awful.button({ modkey }, 3, awful.mouse.client.resize))
-- Set keys
root.keys(globalkeys)
-- {{{ Rules
awful.rules.rules = {
-- All clients will match this rule.
rule = {},
properties = {
border_width = beautiful.border_width,
border_color = beautiful.border_normal,
size_hints_honor = false,
focus = true,
keys = clientkeys,
buttons = clientbuttons
rule = { class = "MPlayer" },
properties = { floating = true }
rule = { class = "pinentry" },
properties = { floating = true }
rule = { class = "gimp" },
properties = { floating = true }
{ rule = { class = "firefox" },
properties = { tag = tags[1][2] } },
{ rule = { class = "Chromium" },
properties = { tag = tags[1][2] } },
{ rule = { class = "Pidgin" },
properties = { tag = tags[1][3] } },
{ rule = { class = "Xchat" },
properties = {tag = tags[1][4] } },
-- Set Firefox to always map on tags number 2 of screen 1.
-- { rule = { class = "Firefox" },
-- properties = { tag = tags[1][2] } },
-- {{{ Signals
-- Signal function to execute when a new client appears.
client.add_signal("manage", function(c, startup)
-- Add a titlebar
-- awful.titlebar.add(c, { modkey = modkey })
-- Enable sloppy focus
c:add_signal("mouse::enter", function(c)
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
client.focus = c
end
end)
if not startup then
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- awful.client.setslave(c)
-- Put windows in a smart way, only if they does not set an initial position.
if not c.size_hints.user_position and not c.size_hints.program_position then
awful.placement.no_overlap(c)
awful.placement.no_offscreen(c)
end
end
end)
client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- {{{ Tag signal handler - selection
-- - ASCII tags 1 [2] 3 4...
-- - start with tag 1 named [1] in tag setup
for s = 1, screencount do
for t = 1, #tags[s] do
tags[s][t]:add_signal("property::selected", function ()
if tags[s][t].selected then
tags[s][t].name = "[" .. tags[s][t].name .. "]"
else--]]
--tags[s][t].name = tags[s][t].name:gsub("[%[%]]", "")
--[[ end
end)
end
end
I have tried to search around for a solution to this, but I am coming up short. Any idea on how to solve this?
Last edited by kveras (2011-11-21 09:01:47)First of all, did you check the wiki and forums? We'll help you, but you have to try to fix it yourself first.
You will need to provide more info if you want help.
Did you set up Gnome to force fallback mode?
Did you look at the Gnome wiki article? There's a few sections that sound like what your looking to do, but the examples are USING OTHER WM's. They still might be able to point you in the right direction. -
Problems getting data from JMenuBar to JInternalFrame
I have modified an example to show my problem. I am trying to take text input from the menu bar and print it into a JTextArea. I don't know how to reference the data in my ActionListener.
The ActionListener is incomplete, but this is basically what I am trying to do:
import javax.swing.JInternalFrame;
import javax.swing.JDesktopPane;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JMenuBar;
import javax.swing.JFrame;
import javax.swing.KeyStroke;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
* InternalFrameDemo.java is a 1.4 application that requires:
* MyInternalFrame.java
public class InternalFrameDemo extends JFrame
implements ActionListener {
JDesktopPane desktop;
JTextField memAddrBox;
JTextArea menuText;
JTextArea frame;
String textFieldString = " Input Text: ";
ActionListener al;
public InternalFrameDemo() {
super("InternalFrameDemo");
//Make the big window be indented 50 pixels from each edge
//of the screen.
int inset = 50;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(inset, inset,
screenSize.width - inset*2,
screenSize.height - inset*2);
//Set up the GUI.
desktop = new JDesktopPane(); //a specialized layered pane
frame = createFrame(); //create first "window"
setContentPane(desktop);
setJMenuBar(createMenuBar());
//Make dragging a little faster but perhaps uglier.
desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
protected JMenuBar createMenuBar() {
JMenuBar menuBar = new JMenuBar();
JLabel memAddrLabel = new JLabel(textFieldString);
memAddrLabel.setLabelFor(memAddrBox);
menuBar.add(memAddrLabel);
JTextField memAddrBox = new JTextField();
memAddrBox.addActionListener(this);
memAddrBox.setActionCommand("chMemAddr");
menuBar.add(memAddrBox);
return menuBar;
//React to menu selections.
public void actionPerformed(ActionEvent e) {
if ("chMemAddr".equals(e.getActionCommand()))
JMenuBar bar = getJMenuBar();
// JTextField memAddrBox = bar.getParent();
String memStartString = memAddrBox.getText();
update(memStartString);
public void update(String temp)
frame.setText(temp);
//Create a new internal frame.
protected JTextArea createFrame() {
JInternalFrame frame = new JInternalFrame("Memory",true,true,true,true);
frame.setSize(650, 500);
frame.setVisible(true);
frame.setLocation(200, 0);
desktop.add(frame);
JTextArea textArea = new JTextArea();
frame.getContentPane().add("Center", textArea);
textArea.setFont(new Font("SansSerif", Font.PLAIN, 12));
textArea.setVisible(true);
textArea.setText("Initial Text");
return textArea;
//Quit the application.
protected void quit() {
System.exit(0);
public static void main(String[] args) {
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true);
//Create and set up the window.
InternalFrameDemo frame = new InternalFrameDemo();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Display the window.
frame.setVisible(true);
class MyInternalFrame extends JInternalFrame {
static int openFrameCount = 0;
static final int xOffset = 30, yOffset = 30;
public MyInternalFrame() {
super("Document #" + (++openFrameCount),
true, //resizable
true, //closable
true, //maximizable
true);//iconifiable
//...Create the GUI and put it in the window...
//...Then set the window size or call pack...
setSize(300,300);
//Set the window's location.
setLocation(xOffset*openFrameCount, yOffset*openFrameCount);
}I want to take the input from the "memAddrBox" and put it into the "frame" using the update() method. Probably a simple solution, but I have not found a similar problem in the Forums.I knew it had to be something simple, here is the fix I found:
import javax.swing.JInternalFrame;
import javax.swing.JDesktopPane;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JMenuBar;
import javax.swing.JFrame;
import javax.swing.KeyStroke;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
* InternalFrameDemo.java is a 1.4 application that requires:
* MyInternalFrame.java
public class InternalFrameDemo extends JFrame
implements ActionListener {
JDesktopPane desktop;
JTextField memAddrBox;
JTextArea menuText;
JTextArea frame;
String textFieldString = " Input Text: ";
ActionListener al;
public InternalFrameDemo() {
super("InternalFrameDemo");
//Make the big window be indented 50 pixels from each edge
//of the screen.
int inset = 50;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(inset, inset,
screenSize.width - inset*2,
screenSize.height - inset*2);
//Set up the GUI.
desktop = new JDesktopPane(); //a specialized layered pane
frame = createFrame(); //create first "window"
setContentPane(desktop);
setJMenuBar(createMenuBar());
//Make dragging a little faster but perhaps uglier.
desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
protected JMenuBar createMenuBar() {
JMenuBar menuBar = new JMenuBar();
JLabel memAddrLabel = new JLabel(textFieldString);
memAddrLabel.setLabelFor(memAddrBox);
menuBar.add(memAddrLabel);
JTextField memAddrBox = new JTextField();
memAddrBox.addActionListener(this);
memAddrBox.setActionCommand("chMemAddr");
menuBar.add(memAddrBox);
return menuBar;
//React to menu selections.
public void actionPerformed(ActionEvent e) {
if ("chMemAddr".equals(e.getActionCommand()))
JTextField textField =
(JTextField)e.getSource();
String memStartString = textField.getText();
update(memStartString);
public void update(String temp)
frame.setText(temp);
//Create a new internal frame.
protected JTextArea createFrame() {
JInternalFrame frame = new JInternalFrame("Memory",true,true,true,true);
frame.setSize(650, 500);
frame.setVisible(true);
frame.setLocation(200, 0);
desktop.add(frame);
JTextArea textArea = new JTextArea();
frame.getContentPane().add("Center", textArea);
textArea.setFont(new Font("SansSerif", Font.PLAIN, 12));
textArea.setVisible(true);
textArea.setText("Initial Text");
return textArea;
//Quit the application.
protected void quit() {
System.exit(0);
public static void main(String[] args) {
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true);
//Create and set up the window.
InternalFrameDemo frame = new InternalFrameDemo();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Display the window.
frame.setVisible(true);
class MyInternalFrame extends JInternalFrame {
static int openFrameCount = 0;
static final int xOffset = 30, yOffset = 30;
public MyInternalFrame() {
super("Document #" + (++openFrameCount),
true, //resizable
true, //closable
true, //maximizable
true);//iconifiable
//...Create the GUI and put it in the window...
//...Then set the window size or call pack...
setSize(300,300);
//Set the window's location.
setLocation(xOffset*openFrameCount, yOffset*openFrameCount);
}Note the e.getSource() change in the ActionListener. -
Unity Connection 7 with overlapping extension
Hello everybody,
I'm deploying a CUCM 7.1.3 + Unity Connecion 7.1.3 to a customer, and I have a doubt when using overlapping extension. As it's a large environment, he has overlapping extension number in his multiple sites. For example, both SiteA and SiteB have the extension range 8XXX. In CUCM I have configured some translations patterns, so that an user from SiteA should dial 118XXX in order to reach SiteB, and an user in SiteB should dial 218XXX in order to reach site A. And each site has its own line partition to extension numbers. And everything works fine...
But these users are all in the same Unity Connection Server. So I would have users from SiteA and SiteB with the same extension in Unity Connection, and I can't do that. What I know can do is to configure some partitions from SiteA and SiteB in CUC, and put each subscriber in one partition, right?
But when a user wants to reach the voice mail to get his messages, how Unity Connection knows from which location is he?
Please, anyone could advise me how can I proceed with this configuration?
Thank you!!!Hello,
I workarounded my problem creating multiple VM Profiles, and assigning a diferent Voice Mail Box Mask for each. And in Unity connection I created a alternate extension for each user.
For example... the extension 6000 from SiteA has the VM Profile VM_SiteA, which has the voicemail box mask 11XXXX. And this user in Connection has the alternate extension 116000. And the extension 6000 from SiteB has the VM Profile VM_SiteB, which has the voicemail box mask 21XXXX, and this user has this number as alternate extension as well (216000)... It works fine like this.
But actually I haven't tested the MWI... If I have a translation pattern in CUCM that translates 11XXXX to XXXX (in partition from SiteA), and another 21XXXX to XXXX (in partition from SiteB), and configure the MWI extension in Connection to be 11XXXX and 21XXXX, will it work? Have anyone already tested this?
Thank you very much!!!
Bruno -
Site-to-ste VPN with overlapped subnet.
Hi Friends
I have to set up site to site VPN with overlapped network ASA 5540 and checkpoint what is the best parctice to achive tis goal
Thanks in advanceIt has to be configured on both sides.
X and Y are unused networks in this example: Site A has to hide 172.16.1.0/24 behind X when communicating to Y, site B has to hide 172.16.1.0/24 behind Y when communicating to X. The users in site A have to use Y as a destination, users in site B have to use X as destination. To make it usable for the users you should include the destinations in the DNS so that they never need the destination-IP.
On the ASA you describe the communication 172.16.1.0/24 -> Y with an access-list and add that ACL to your static-command. You find an example here:
http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/products_configuration_example09186a00808c9950.shtml
Don't stop after you've improved your network! Improve the world by lending money to the working poor:
http://www.kiva.org/invitedby/karsteni -
ASA 5505: Site-to-Site VPN, NAT (Overlap Subnets)
Greetings all. I've searched through the forums and have found some similar situations to mine but nothing specific. I'm hoping this is an easy fix... :/
I volunteer for a non-profit medical facility that has an ASA 5505 (v8.4). They needed a site-to-site VPN to another facility (a Fortinet w/ 10.10.115.0/24) to securly transfer digital X-Ray images. Very simple setup... the issue is, my 5505 (192.168.1.x) overlaps with another site-to-site VPN connection on the Fortinet side already. So...
The network admin on the Fortinet side assinged me 172.31.1.0/24. I have established a connection but obviously, cannot route anywhere to the other side. Anyone have any suggestions here, how I might be able to accomplish this - hopefully with a simple NAT setup?
Thank you in advance everyone.Hello Chris,
For this scenario you will need to create a Policy-NAT rule and then configure the Interesting Traffic with the translated IP address.
Basically the NAT configuration will be like this:
object network Local-net
subnet 192.168.1.0 255.255.255.0
object network Translated-net
subnet 172.31.1.0 255.255.255.0
object network Fortinet-net
subnet 10.10.115.0 255.255.255.0
nat (inside,outside) source static Local-net Translated-net destination static Fortinet-net Fortinet-net
Obviously, you can change the name of the objects.
Then in the interesting traffic, the ACL that is apply in the crypto map that defines the VPN traffi, you will need to configure it like this:
access-list anyname permit ip 172.31.1.0 255.255.255.0 10.10.115.0 255.255.255.0
This should allow you to pass traffic over this tunnel and it will hide your network behind the network that the Fortinet assigned you.
Let me know if you have any doubts.
Daniel Moreno
Please rate any posts you find useful -
ASA VPN - Overlapping networks
Hello.
I have a problem that I have a small branch with ASA-5505 using the VPN connects to two branches and headquarters, unfortunately, even though I used the crypto-map priority, in this configuration, it does not work.
I mean, first to move traffic to Lodz network with accurate mask 10.57.0.0/255.255.240.0 and then to the Head Office (Warsaw) network with the overlying network mask Lodz network 10.0.0.0/255.0.0.0
I also wanted to add that if I configure the same VPN to other networks without overlapping then this work properly, so I know that the problem is related with overlapping.
How to configure ASA when last network with big mask /8 overlapping with other networks with smaller masks /14 or /20 bits.
Please find attached diagram and configuration part.
access-list Wan1_cryptomap extended permit ip object LocalNetworkVPN object VPNRemoteLodz (10.57.0.0 255.255.240.0)
access-list Wan1_cryptomap_1 extended permit ip object LocalNetworkVPN object VPNRemoteWarszawa (10.0.0.0 255.0.0.0)
crypto ipsec security-association pmtu-aging infinite
crypto map Wan1_map 20 match address Wan1_cryptomap
crypto map Wan1_map 20 set peer 107.x.x.41
crypto map Wan1_map 20 set ikev1 transform-set ESP-3DES-SHA
crypto map Wan1_map 600 match address Wan1_cryptomap_1
crypto map Wan1_map 600 set peer 107.x.x.70
crypto map Wan1_map 600 set ikev1 transform-set ESP-3DES-SHA
crypto map Wan1_map interface Wan1
crypto map Wan1_map interface Wan2
Thank you.Hello, Tomasz Hinz.
Not sure that this helps but can you try add line:
access-list Wan1_cryptomap_1 extended deny ip object LocalNetworkVPN object VPNRemoteLodz
Best Regards. -
Delete Overlapping requests question
Hi ,
How would a Delete overlapping requests (DOR)type work in a PC to a Cube that gets a full load every day with selections for rolling 12 months?
Say there is a scenario to load data into an AR line items cube to update open to closed items history and the loads are configured for a 12 month rolling. eg yesterdays full would be for 03/23/09 to 03/23/10
today's 03/24/09 to 03/24/10
Now how can we utilize DOR instead in a PC that would delete the doubling behaviour of data for dates 03/24/09 to 03/23/10?
All thoughts appreciated.
ThanksHi,
in The selection criteria of the info package u can have the following code which takes the selection criteria as the first day to last day of the month based on previous days date(SY-DATUM - 1.)
data: l_idx like sy-tabix,
dDATE1 LIKE SY-DATUM,
dDATE LIKE SY-DATUM,
L_LOW LIKE RSSDLRANGE-LOW,
L_HIGH LIKE RSSDLRANGE-HIGH.
read table l_t_range with key
fieldname = 'END_SHIFTDATE'.
l_idx = sy-tabix.
dDATE1 = SY-DATUM - 1.
CALL FUNCTION 'ZFNC_FIRSTDAY_MONTH'
EXPORTING
DDATE = dDATE1
IMPORTING
DLAST_DATE = dDATE.
L_LOW = dDATE.
L_T_RANGE-LOW = L_LOW.
L_T_RANGE-SIGN = 'I'.
L_T_RANGE-OPTION = 'BT'.
CLEAR dDATE.
CALL FUNCTION 'ZFNC_LASTDAY_MONTH'
EXPORTING
DDATE = dDATE1
IMPORTING
DLAST_DATE = dDATE.
L_HIGH = dDATE.
L_T_RANGE-HIGH = L_HIGH.
modify l_t_range index l_idx.
and DOR deletes the previous day's request as the selection criteria is same. on first day of the next month it has a request with selection criteria as first to last date of the previous month. and this request is not deleted since on 2nd of the month it has different selection criteria(Start daay and end day of that month)
Hope its clear
Thanks,
Sandeep -
Can I use JavaScript to force objects to overlap a Web Object in Captivate 7?
Hi, so I have all of these great ideas for using Web Objects to enhance my courses, but am discouraged by the fact that I can't seem to get anything to overlap a Web Object. The only thing I can seem to get to overlap a Web Object is another Web Object. I have found that buttons seem to still work under the Web Object (which is good) but I really would like to know of a way to allow things on the Captivate timeline to be viewed on top of them. Things like text fields and images.
I've seen posts about how to use JavaScript to have the menu show above Web Objects, but that code doesn't seem to work for regular objects. I read that Web Objects sit in an "<iframe>" tag and that that forces it to appear above everything else. I'm left wondering if it is possible to get around this by somehow putting Captivate objects in an <iframe> of their own with JavaScript? Or is there some other way? Does anybody know any JavaScript I can apply to Captivate objects to get them to appear above a Web Object?
Thanks,
DanSo I have come to learn that the "<iframe>" tag for a Web Object is simply a window that sits on top of the course. Now I'm wondering if anyone has an effective method for importing flash quality animation (in whatever form) that can sit underneath of Captivate objects and still be HTML5 compliant?
Thanks,
Dan
Maybe you are looking for
-
Adobe Photoshop CS6 Extended Could not complete your request because of a program error.
When starting Photoshop CS6 I get this error message, Adobe Photoshop CS6 Extended Could not complete your request because of a program error (-- OK --). This happens on the main screen immediately. Once I click OK the program seems to be alright.
-
Can we have a Tab page build in OAF
Hi All .. Can we build TabPage in OAF?? I have two tables,i want to display one table information in one tab page n 2 nd table in 2 nd tab page. How can i build it? Please send me the reference links on the same? Thanks,
-
Hi All, I would like to work on Soap to File scenario(model). Soap message is availbale in XML file.that i need to send as file to target system. I'm unable to find any file picking option in soap adapter. If i'm doing wrong approach could any one su
-
How deploy javafx Applet in Tomcat
Hi all! Please help me. How i can deploy JavaFX Applet in Tomcat
-
Hi, I am trying to apply some SAP Notes in one of our BI systems. Currently we are on SP 18 of SAP_BW (release 700). The Notes that I am trying to apply are delivered in SP 19. So that part is okay. The problem is that these Notes need some prerequis