Remove weird shade from a box, renpy - renpy

Does anyone have any idea where this shade on the right comes from? I can't figure out which parameter might be responsible.
screen phone():
window:
xalign 1
yalign 0
xpos 1400
ypos 10
add "bg_smartphone"
window:
xalign 1
yalign 0
xpos 1800
ypos 10
vbox:
imagebutton auto "smartphone_%s":
action If(renpy.get_screen("phone"), true=Hide("phone"), false=Show("phone"))

Related

How to add missing borders to FMX controls?

I'm currently designing an FMX app with C++Builder. For some reason, when the app is built and launched (it looks normal in the editor), the upper and left border of TComboEdits are missing. Same for the right border of grids. This is quite unpleasant to the eye, how to change that?
Here is the design-time settings for one of the TComboEdits:
object SearchLotComboEdit: TComboEdit
Touch.InteractiveGestures = [LongTap, DoubleTap]
TabOrder = 2
ItemHeight = 19.000000000000000000
ItemIndex = -1
Position.X = 72.000000000000000000
Position.Y = 40.000000000000000000
Size.Width = 361.000000000000000000
Size.Height = 26.000000000000000000
Size.PlatformDefault = False
OnChange = SearchLotComboEditChange
OnTyping = SearchLotComboEditTyping
OnKeyDown = SearchLotComboEditKeyDown
I added pictures of what it looks like:
I have the same problem om my computer.
The problem is due to the fact that FMX does not paint some controls (e.g. Listbox misses right border) correctly when your Windows scaling isn't configured at 100%.
It probably depends on your screen resolution as well.
Try 100%, 125% or 150% scaling and observe if there are any differences.

What is the error of saved frame using saveFrame()

Using the code shown at http://processing.org/reference/saveFrame_.html I seem to be getting a grey overlay on every frame I try and output from any number of different sketchs? The grey bar overlay seems to grow as the more frame are saved. Has anyone else experienced this? Have I done something incorrect?
The code that is doing this gray area in your sketch is this:
if (xport < 100) {
line(xport, 0, xport, 100);
xport = xport + 1;
}
I don't exactly know what you wanted to do, but its drawing a vertical line with xport as x and from 0 to 100 as y

Matlab, GUI, Scrolling content in Pane. How to hide overflow?

I am trying to make a Matlab GUI that has a panel with scrolling content inside of a larger figure. I am having a problem hiding the overflow content when it scrolls out of the subpanel.
I got the code for the scrollbar from this SO post: Adding scroll bar in subplots within GUI
Try the code below. I have a figure, an outer panel (smaller than the figure, child to the figure), a scrolling panel (with a height greater than the figure, child to outer panel), a scroll bar, and a text field to appear in the scrolling pane (child to the scrolling panel).
When you try the code you will see the text string, which is just the alphabet repeated, scrolls up and down the whole length of the figure, but the scrolling panel stops at the edge of the limits of the outer panel.
How can I correct this problem. Thanks.
function guitest
scrsz = get(0,'ScreenSize');
height = scrsz(4)*7/8;
width = scrsz(3)*2/3;
leftmargin = 10;
rightmargin = 10;
% figure
handles.hFig = figure('Visible','on',...
'Position', [scrsz(3)/8 scrsz(4)/10 width height],...
'Name', 'Tap Toolbar Report',...
'NumberTitle', 'off',...
'Color', [0.75 0.75 0.75],...
'ToolBar','none',...
'MenuBar','none',...
'Resize','off');
% subpanel in the figure for scrolling
handles.hOut = uipanel('Parent',handles.hFig,...
'BackgroundColor', [0.85 0.85 0.85],...
'BorderWidth', 0,...
'Units', 'pixels',...
'Position',[leftmargin 100 width-2*leftmargin height-200]);
hPanheight = 2000;
handles.hPan = uipanel('Parent',handles.hOut,...
'BackgroundColor', [0.85 0.85 0.85],...
'BorderWidth', 0,...
'Units', 'pixels',...
'Position',[0 0 width-2*leftmargin-19 hPanheight]);
str = sprintf('a\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nr\ns\nt\nu\nv\nx\ny\nz\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nr\ns\nt\nu\nv\nx\ny\nz\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nr\ns\nt\nu\nv\nx\ny\nz\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nr\ns\nt\nu\nv\nx\ny\nz\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nr\ns\nt\nu\nv\nx\ny\nz\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nr\ns\nt\nu\nv\nx\ny\nz\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nr\ns\nt\nu\nv\nx\ny\nz\na\nb\nc\nd\ne\nf\ng\nh\ni\nj\nk\nl\nm\nn\no\np\nq\nr\ns\nt\nu\nv\nx\ny\nz');
uicontrol('Parent', handles.hPan,'Style','text','String',str,'FontSize', 10,'FontWeight','bold', 'HorizontalAlignment', 'left',...
'Position',[10 20 20 1960],'BackgroundColor', [0.85 0.85 0.85]);
handles.hSld = uicontrol('Style', 'slider',...
'BackgroundColor', [0.8 0.8 0.8], ...
'Position', [width-leftmargin-20 101 19 height-202],...
'Callback', {#onSlide,handles.hPan,handles.hOut});
set(handles.hSld,'Value',1);
onSlide(handles.hSld,'',handles.hPan,handles.hOut)
end
function onSlide(hSld,~,hPan,hOut)
%# slider value
offset = get(hSld,'Value');
%# update panel position
p = get(hPan, 'Position'); %# panel current position
ph = get(hOut, 'Position');
set(hPan, 'Position',[p(1) -offset*(p(4)-ph(4)) p(3) p(4)])
end
I would use a container object that has scroll capability built-in. Take a look at:
help uitable
help uitree

How do you calculate the height of the title bar in VB6?

I'm trying to display one form relative to a Button on a control below it.
But Button.top is relative to the titlebar of the bottom form, and the top form will be relative to the screen.
So, to compensate for that I need to now how tall the titlebar is.
I've used Form.height-Form.ScalehHeight but ScaleHeight doesn't include the title bar or the border so Scaleheight is inflated slightly.
Anyone know how to calculate the height of just the title bar?
You need to use the GetSystemMetrics API call to get the height of the titlebar.
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Private Const SM_CYCAPTION = 4
Property Get TitleBarHeight() as Long
TitleBarHeight = GetSystemMetrics(SM_CYCAPTION)
End Property
Note: This will return the height in pixels. If you need twips you will have to convert using a form's ScaleY method like so: Me.ScaleY(TitleBarHeight(), vbPixels, vbTwips)
Subtract it back out:
(Form.height-Form.ScaleHeight) - (Form.Width-Form.ScaleWidth) / 2
"Recursive's" answer above is not quite correct. It subtracts twice the border width - there is a border on the left and one on the right!
We get the best results with this:
(Form.Height-Form.ScaleHeight) - (Form.Width-Form.ScaleWidth)/2
' For completeness:
Public Const SM_CYCAPTION = 4
Public Const SM_CYBORDER = 6
Public Const SM_CYFRAME = 33
' in Pixels
Property Get NonClinetHeight()
FrameH = GetSystemMetrics(SM_CYFRAME) ' Total height, Top + Bottom
CaptionH = GetSystemMetrics(SM_CYCAPTION)
BorderH = GetSystemMetrics(SM_CYBORDER) ' Border around Client area
NonClinetHeight = FrameH + CaptionH + (BorderH * 2)
End Property
You'll probably need to make a Win32 API call to GetSystemMetrics()
You can use the ClientToScreen() windows API function to convert a point from client coordinates to screen coordinates:
Dim Position As Point
Position.x = 0
Position.y = 0
ClientToScreen Me.hWnd, Position
FormTop = Position.y
If you want to skip this and go direct to the button, you can use the button's position (in pixels):
Position.x = This.ScaleX(Button.Left, this.ScaleMode, vbPixels)
Position.Y = This.ScaleY(Button.Top, this.ScaleMode, vbPixels)
...
Or just get the buttons position using GetWindowRect()
Dim Position2 As Rect
GetClientRect Button.hWnd, Position2
Position.x = Position2.left
Position.y = Position2.top
...

Vertical Scrolling Marquee for foxpro

Could anyone could point me to some code/give me ideas on how to create a smooth scrolling vertical marquee for VFP 8 or 9?
Any help is appreciated.
Here's a quick program that will scroll messages. Put the following in a prg file and run it.
I'd make a containerScrollArea a class that encapsulates the timer, labels, and scrolling code. Give it GetNextMessage method that you can override to retrieve the messages.
* Put a container on the screen to hold our scroller
_screen.AddObject("containerScrollArea", "container")
WITH _Screen.containerScrollArea
* Size it
.Visible = .t.
.Width = 100
.Height = 100
* Add two labels, one to hold each scrolling message
.AddObject("labelScroll1", "Label")
.AddObject("labelScroll2", "Label")
* This timer will move the labels to scroll them
.AddObject("timerScroller", "ScrollTimer")
ENDWITH
WITH _Screen.containerScrollArea.labelScroll1
* The labels are positioned below the margin of the container, so they're not initially visible
.Top = 101
.Height = 100
.Visible = .t.
.WordWrap = .t.
.BackStyle= 0
.Caption = "This is the first scrolling text, which is scrolling."
ENDWITH
WITH _Screen.containerScrollArea.labelScroll2
* The labels are positioned below the margin of the container, so they're not initially visible
.Top = 200
.Height = 100
.Visible = .t.
.WordWrap = .t.
.BackStyle= 0
.Caption = "This is the second scrolling text, which is scrolling."
ENDWITH
* Start the timer, which scrolls the labels
_Screen.containerScrollArea.timerScroller.Interval = 100
DEFINE CLASS ScrollTimer AS Timer
PROCEDURE Timer
* If the first label is still in view, move it by one pixel
IF This.Parent.labelScroll1.Top > -100
This.Parent.labelScroll1.Top = This.Parent.labelScroll1.Top - 1
ELSE
* If the first label has scrolled out of view on the top of the container, move it back to the bottom.
This.Parent.labelScroll1.Top = 101
* Load some new text here
ENDIF
IF This.Parent.labelScroll2.Top > -100
* If the second label is still in view, move it by one pixel
This.Parent.labelScroll2.Top = This.Parent.labelScroll2.Top - 1
ELSE
* If the second label has scrolled out of view on the top of the container, move it back to the bottom.
This.Parent.labelScroll2.Top = 101
* Load some new text here
ENDIF
ENDPROC
ENDDEFINE
You can use Scrollable Container
Unfortunately the nature of my work leaves me no time for fooling around with graphics, however if I did I would look into using GDI+ with VFP. Here is an article to get you started

Resources