window

Java AWT application window padding

≡放荡痞女 提交于 2020-01-04 09:21:29
问题 I'm trying to build a simple AWT application in Java. I want all of the containers in the main window to be separated by bit. I can accomplish this by setting the Hgap and Vgap in the BorderLayout constructor (see below.) However, I can't figure out how to put a cap between the containers and the edges of the main window. How do I add a few pixels of padding to the main window? import java.awt.*; import java.applet.Applet; public class LayoutTest extends Applet { public void init() {

Java AWT application window padding

不羁的心 提交于 2020-01-04 09:18:56
问题 I'm trying to build a simple AWT application in Java. I want all of the containers in the main window to be separated by bit. I can accomplish this by setting the Hgap and Vgap in the BorderLayout constructor (see below.) However, I can't figure out how to put a cap between the containers and the edges of the main window. How do I add a few pixels of padding to the main window? import java.awt.*; import java.applet.Applet; public class LayoutTest extends Applet { public void init() {

How to change window style/theme in c++

丶灬走出姿态 提交于 2020-01-04 05:57:28
问题 I need an approach how to customize the window style like Steam or Spotify. I don't want to have the boring Windows (or any other OS) look. Can that be done with Qt or the WinApi? Do I need DirectX or OpenGL for doing that? Best Regards 回答1: Yes, you can do it with the WinAPI. The primary message you care about is WM_NCPAINT . That's what's sent when the non-client areas of a window (e.g., the frame and title bar) need to be painted. Note that by default, rendering of the non-client areas is

How to change window style/theme in c++

佐手、 提交于 2020-01-04 05:57:14
问题 I need an approach how to customize the window style like Steam or Spotify. I don't want to have the boring Windows (or any other OS) look. Can that be done with Qt or the WinApi? Do I need DirectX or OpenGL for doing that? Best Regards 回答1: Yes, you can do it with the WinAPI. The primary message you care about is WM_NCPAINT . That's what's sent when the non-client areas of a window (e.g., the frame and title bar) need to be painted. Note that by default, rendering of the non-client areas is

QML get the winId of a loaded qml window

落花浮王杯 提交于 2020-01-04 05:44:10
问题 I would like to get the winId of a qml window. I have the following files. main.qml : import QtQuick 2.5 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 Window { id: myMainWindow title: "MyMainWindow" width: 200 height: 200; visible: true Component.onCompleted: { x = 40 y = 40 } } and my main.cpp : #include <QGuiApplication> #include <QQmlApplicationEngine> #include <QWindow> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine;

How can I tell, if window is in a jQuery set?

故事扮演 提交于 2020-01-04 04:26:11
问题 I want my jQuery plugin to behave differently, when called on a $(window) selection. How can I check, if window is in the set? My tries so far: >>> $(window) == $(window) false >>> $(window).is(window) false >>> $(window).filter(window).length 0 (Those all work fine for document , by the way.) Of course I can always inspect this[0] , but there are edge cases like $('a').add(window) that are not catered by this approach. I can also filter via function: >>> $(window).filter(function() { return

Xlib: Create window in mimized or maximized state

非 Y 不嫁゛ 提交于 2020-01-04 03:03:23
问题 Is it possible to create a Window in maximized or minimized state with Xlib? If so, how would I go about doing that? 回答1: Something like this; XEvent xev; Atom wm_state = XInternAtom(dpy, "_NET_WM_STATE", False); Atom max_horz = XInternAtom(dpy, "_NET_WM_STATE_MAXIMIZED_HORZ", False); Atom max_vert = XInternAtom(dpy, "_NET_WM_STATE_MAXIMIZED_VERT", False); memset(&xev, 0, sizeof(xev)); xev.type = ClientMessage; xev.xclient.window = win; xev.xclient.message_type = wm_state; xev.xclient.format

jQuery - Treat multiple instances of the same class separately?

让人想犯罪 __ 提交于 2020-01-03 17:49:08
问题 Goal: I'm trying to create a parallax scrolling effect. The parallax-container are implemented like so: < div class="parallax slide-1" > < /div > I need the parallax effect to start, when its container is scrolled into view . Once it has left the view , the effect needs to stop. The Problem: The jQuery works fine so far. But: Since I can have multiple parallax-container on one page (e.g. one at the top + one at the bottom) I need them to be treated independently by jQuery. At the moment the

How is “Esc” key handled in WPF Window?

≡放荡痞女 提交于 2020-01-03 12:58:28
问题 I want the Escape key to close my WPF window. However if there is a control that can consume that Escape key, I don't want to close the Window. There are multiple solutions on how to close the WPF Window when ESC key is pressed. eg. How does the WPF Button.IsCancel property work? However this solution closes the Window, without regard to if there is an active control that can consume the Escape key. For eg. I have a Window with a DataGrid. One of the columns on the dataGrid is a combobox. If

JS “Window” width-height vs “screen” width-height?

倖福魔咒の 提交于 2020-01-03 10:26:39
问题 I am wondering a little when I look at this code: // Get the screen height and width var maskHeight = $(document).height(); var maskWidth = $(window).width(); ... // Get the window height and width var winH = $(window).height(); var winW = $(window).width(); What is the difference between $(document).height(); and $(window).height(); ? 回答1: $(document).height is the inside area of the viewport, essentially from the bottom of your toolbar/url bar to your status bar/bottom scroll bar/bottom of