error: 'ccc4' was not declared in this scope - cocos2d-x

I follow the tutorial "Chapter 2 - How to Add a sprite"
and get : Help! error: 'ccc4' was not declared in this scope
without this string :
"CC_BREAK_IF(! CCLayerColor::initWithColor( ccc4(255, 255, 255, 255) ) );"
works good
what's wrong?

You should try this:
CC_BREAK_IF(! CCLayerColor::initWithColor( ccc4f(255, 255, 255, 255) ) );

Related

Is it possible to acces information from an entry inside of a definition and use it outside of the definition

The goal is to make a program where you first get to chose if you want to anwser question 1 or 2. As you make your choice a secondary window appears where you enter your anwser. Because of this information is obtained through a entry in a secondary window. The entry is therefore defined inside of a definition(atleast in my code). Because of this the program will not launch as the "vm" in "print(vm)" is not initially deffined.
Is there maybe a way of delaying the print action until "vm" is defined?
(only a part of the code)
def open2():
global top2
top2 = tk.Toplevel()
top2.title('second window')
lbl2 = tk.Label(top2, text='question 1')
lbl2.place(y=50, x=150)
global ent2
ent2 = tk.Entry(top2, bd=0, bg=rgb_hack((255, 255, 255)))
ent2.place(y=100, x=150)
top2.config(bg=rgb_hack((163, 236, 165)))
top2.geometry("450x250")
btnbm = tk.Button(top2, text='ok', command=entbm).pack()
root.withdraw()
def entbm():
global vm
vm = (ent2.get())
vm = vm.replace(' ', '').lower()
top2.destroy()
return vm
print(vm)
root = tk.Tk()
root.title('first window')
root.geometry("450x250")
root.config(bg=rgb_hack((163, 236, 165)))
btn1 = tk.Button(root, text="to question 1", command=open1, bd=0, height=2, width=20, bg=rgb_hack((255, 255, 255)))
btn1.place(y=50, x=150)
btn2 = tk.Button(root, text="to question 2", command=open2, bd=0, height=2, width=20, bg=rgb_hack((255, 255, 255)))
btn2.place(y=100, x=150)
tk.mainloop()

Add linear gradient over dynamic background-image in Angular 6

I have the following html code but it doesn't seem to work.
I'm trying to add a linear gradient over a dynamic background image url using Angular 6.
<header *ngIf="user?.backgroundPhotoUrl != null && user?.backgroundPhotoUrl !== ''"
[style.background-image]="'linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('+ user?.backgroundPhotoUrl +')'">
But it just comes back blank. Any help?
Take a look at the browser's console. Likely it will contain the following Angular warning:
WARNING: sanitizing unsafe style value linear-gradient(rgba(0, 0, 0, 0.3),.... (see http://g.co/ng/security#xss).
If this is the case, Angular will simply have removed your style rule because the Angular team decided that any custom style binding may potentially be harmful i.e. when the value would be derived from user input.
You will have to declare your bounded style rule as save, by wrapping that value like this:
<header [style]="headerStyle"> ...</header>
get headerStyle() {
return this.sanitizer.bypassSecurityTrustStyle(
' background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3)), url(' + this.backgroundPhotoUrl + '); '
);
}
this.sanitizer is an injected DomSanitizer.

chtobj.Chart.ChartArea.Format.Fill.Visible= msoFalse getting mismatch error

I have created a object and need to set Format.Glow, Format.Fill and Format.SoftEdge.Radius etc
The code from excel uses With Selection but that's not allowed in access. I used the watch window and see the properties but can't assign anything.
enter code here
For Each chtobj In shtTemp.ChartObjects
If chtobj.Name = "Chart4" Then
Debug.Print chtobj.Name
'
chtobj.Chart.ChartArea.Format.Fill.Visible = msoTrue
chtobj.Chart.ChartArea.Format.ForeColor.RGB = RGB(0, 176, 80)
chtobj.Chart.ChartArea.Format.Transparency = 0
chtobj.Chart.ChartArea.Format.Solid
With chtobj.Chart.ChartArea.Format.Glow
.Color.RGB = RGB(255, 255, 0)
.Transparency = 0
.Radius = 10
End With
chtobj.Chart.ChartArea.Format.Line.Visible = msoFalse
chtobj.Chart.ChartArea.Format.SoftEdge.Radius = 1
End If
Next
I found the correct syntax for VBA:
chtobj.Chart.Shapes.Parent.ChartArea.Format.Fill.Visible = msoTrue

Textbox_AfterUpdate not working with another control

Why I can't change value of another control in access form in afterupdate function?
Private Sub cNPSrate_AfterUpdate() 'Form_new_opinion_in!
If Not IsNull(cNPSRate) Then
Select Case cNPSRate
Case 1 To 6
cNPSRate.BackColor = RGB(255, 0, 0) And cSegmentNPS.Text = "KRYTYK"
Case 7 To 8
cNPSRate.BackColor = RGB(255, 255, 0) And cSegmentNPS.Text = "NEUTRALNY"
Case 9 To 10
cNPSRate.BackColor = RGB(0, 255, 0) And cSegmentNPS.Text = "PROMOTOR"
End Select
Else
cNPSRate.BackColor = RGB(255, 255, 255) And cSegmentNPS.Text = Null
End If
End Sub
The code works if I remove And cSegmentNPS.Text. Can't I use another control in this function or I make some mistake?
cNPSRate and cSegmentNPS are TEXTBOXes
A text box's .Text property is only available when that text box has focus. At any other time, use its .Value property instead.
I would also put each action on its own line instead of combining them with And on one line.
So I suggest you revise your code to follow this pattern ...
cNPSRate.BackColor = RGB(255, 0, 0)
cSegmentNPS.Value = "KRYTYK"

How to programmatically apply MapXtreme Themes

I maintain a Desktop application using MapXtreme 7.0 and I have
trouble finding much documentation or useful examples (I do have the
pdfs, samples etc that come on the install discs)
Currently I am trying to programmaticly apply an IndividualValueTheme
to a FeatureLayer. I can apply a standard default theme, I can also
show a ModifyIndValueThemeDlg and let the user change the theme.
However what I want to do is apply my own theme to the layer without
user intervention.
The following code attempts to do this but results in the Layer
showing with the default IndividualValueTheme (ie not with my styles)
Any help would be greatly appreciated
void ApplyTheme(FeatureLayer lyr)
{
if (lyr.Modifiers.Contains(HarvOpsTheme) || lyr.Modifiers.Contains(HarvOpsRangedTheme))
return;
HarvOpsTheme = new IndividualValueTheme(lyr, "iOperationType","HarvOpsTheme");
lyr.Modifiers.Append(HarvOpsTheme);
HarvOpsTheme.Bins[0].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(255, 255, 0)));
HarvOpsTheme.Bins[1].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(0, 255, 0)));
HarvOpsTheme.Bins[2].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(128, 128, 0)));
HarvOpsTheme.Bins[3].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(192, 128, 0)));
HarvOpsTheme.Bins[4].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(0, 128, 0)));
HarvOpsTheme.Bins[5].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(0, 205, 128)));
HarvOpsTheme.Bins[6].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(255, 0, 0)));
HarvOpsTheme.Apply(HarvOpsTheme);
HarvOpsTheme.RecomputeStyles();
lyr.Invalidate();
}
AreaStyle GetHollowAreaStyle(Color color)
{
return new AreaStyle
{
Interior = StockStyles.HollowFillStyle(),
Border = new SimpleLineStyle(new LineWidth(1,LineWidthUnit.Pixel), 1, color)
};
}
For Individual Theme only,recomputing styles causes to regenerate the first theming result.After user changes styles by [Bins] you do not need to recompute them again.
In short, simply remove the line and let the magic happen
HarvOpsTheme.RecomputeStyles();
Best Regards