I alleady have 2 buttons on my frame but when I try to add 3rd button QtCreator stops working. When I try to add another frame same thing happend. Here is the sample of my code.
QFrame *buttonFrame = new QFrame(this);
buttonFrame->setGeometry(930,900,750,100);
buttonFrame->setFrameShape(QFrame::StyledPanel);
QPushButton *nextbutton = new QPushButton(buttonFrame);
nextbutton->setText("Sonraki ");
nextbutton->setLayoutDirection(Qt::RightToLeft);
nextbutton->setMinimumSize(25,30);
QPushButton *downloadButton = new QPushButton(buttonFrame);
downloadButton->setText(" İndir");
downloadButton->setMinimumSize(25,30);
QPushButton *totalButton = new QPushButton(buttonFrame);
totalButton->setText("Tüm veriyi göster");
totalButton->setMinimumSize(25,40);
buttonLayout->addWidget(downloadButton,0,1);
buttonLayout->addWidget(nextbutton,0,2);
buttonLayout->addWidget(totalButton,0,3);
This code works perfectly when totalButton commend outed but when I try to add it inside the buttonFrame QtCreator stops working. Any help will be appreciated. Thanks!
My main window was initializing fixed size that I give previously. The problem solved when I deleted fixed size feature and initalize main window default size. I hope it helped anyone who has same problem.
Related
I'm facing a problem with this 2 ScrollBox, one is TVertScrollBox which display whole screen and it have a THorzScrollBox in it, my problem is if i want to touch to the HorzScrollbox item and move up and down, my VertScrollBox have to scroll same as. Are there any ways to solve this issue? Thanks in advance
//Edit 1 : I'm using a gesture and ScrollBy(x,y) function to do with this issue. But it seem a bit laggy(not smooth) and still the HorzitonScrollBox scroll it own. A image for this(http://i.imgur.com/weOqW0R.gifv). Still watting another solution to do this
You can do it using UICollectionView as given in below example project.
http://damir.me/implementing-uicollectionview-layout
Source code link: http://bascarsija.s3.amazonaws.com/CollectionView.zip
After downloading this source code, In build settings change the value of the "Compiler for C/C++/Objective-C" to Default Compiler and run the app.
OK, I have found a simple answer.
When you have a THorzScrollBox inside of a TVertScrollBox, set THorzScrollBox.Touch.InteractiveGestures.Pan to False.
I have a Windows Phone 7.1 app and I want to include a wide iconic tile. I found a library called MangoPollo:
http://mangopollo.codeplex.com/
I found this code within:
var tile = ShellTile.ActiveTiles.FirstOrDefault();
if (tile != null)
{
var tileData = new FlipTileData();
tileData.Title = "Start Debugging";
tileData.BackContent = "switch to windows phone, we've got candy";
tileData.BackgroundImage = new Uri("Assets/tileBackground.png", UriKind.Relative);
tileData.BackBackgroundImage = new Uri("Assets/tileBackBackground.png", UriKind.Relative);
tileData.WideBackContent = "switch to windows phone, we've got candy";
tileData.WideBackgroundImage = new Uri("Assets/wideTileBackground.png", UriKind.Relative);
tileData.WideBackBackgroundImage = new Uri("Assets/wideTileBackBackground.png", UriKind.Relative);
tile.Update(tileData);
}
The problem is there isn't any documentation included on Codeplex for the project so I'm not sure where to insert this code (i.e. which function) to change the tile size from normal to wide.
Another way of creating Wide Tile in Windows Phone 7. Tested it and it works.
Check this out.
http://www.supersmithbros.com/index.php/latest-news/93-how-to-create-a-wp8-wide-tile-in-wp7-xna
You may call it where you want and there is no code to change tile at the user screen, because it's not allowed.
If you look in the source code, in the link to MangoPollo which you supplied, the sample code places the tile code in a button click event. So what I would do in your app, is make an option to set up this new tile (settings page, maybe?) and when the user turns this setting on, you would run the code in that event handler.
This way, the code doesn't unnecessarily execute multiple times (as it would if it were in the constructor of a page or in app.xaml.cs).
Hope this helps!
Edit:
Based on your comment then, maybe you can put it in the constructor of your first page. Maybe, then, to prevent the code from executing more than necessary, you could check the existing tile to see if it already has a WideBackgroundImage, and if it doesn't, then set it and call Update() otherwise just continue.
I'm getting started with Windows 8 App development using WinJS. I'm using the Light UI theme but I have set up a darker area on the left of the page (where the black back button is) and the issue is: you can't see the button.
I've trawled through the MSDN pages and the most I could find is how to style a button which doesn't actually explain how to change the colour of an actual asset.
http://msdn.microsoft.com/en-us/library/windows/apps/jj835822.aspx
I've also tried adding: win-ui-light and win-ui-dark classes to the button with no success.
I wondered if someone could point me in the right direction?
Many thanks for your time
Chris
First of all you have to delete the link tag that contain UI css by default and add it to document head , Dynamically.see below code :
var uistyle;
// call when your app load or resume.
function onappopen(){
uistyle = document.createElement('link');
uistyle.href = "//Microsoft.WinJS.2.0/css/ui-dark.css";
uistyle.rel = "stylesheet";
uistyle.id = "UIstyle";
document.head.appendChild(uistyle);}
// call when you want to change UI Style.
function UIstyle(UIbool){
if(UIbool=='light'){ uistyle.href = "//Microsoft.WinJS.2.0/css/ui-light.css";}
else {uistyle.href = "//Microsoft.WinJS.2.0/css/ui-dark.css";}}
Like: UIstyle('light'); for light UI in Windows 8 or "UIstyle()" for dark;
I used the DOM Explorer to find the buttons default values and overwrite them. It was the child element that needed to be overwritten: .win-back
in my optionMenuScreen the user picked a poto and then pressed back to the mainMenu and then playGame.
when i'm trying to get the photo in the gamePlayScreen after pressing the back button, its null again.
OptionsMenuScreen photo = new OptionsMenuScreen();
PhotoTexture = new Texture2D(ScreenManager.GraphicsDevice, 50, 50);
PhotoTexture= photo.photoRecieved;
PhotoTexture = Texture2D.FromStream(ScreenManager.GraphicsDevice, photo.PhotoResult.ChosenPhoto);
PhotoPosition = new Vector2(650f, 150f);
1. do i have to go straight to the next screen without back button or do you have another solution? what can i do to make it work?
2. how to enable the user to crop the picture as he wishes to the size i define?
help!!!
thanks alot
Please include the code for the Photo Chooser; you haven't actually included the code that is your issue, which is why your having this problem :-)
Check that you haven't actually disposed the photo that was taken; in this scenario you can just test with a static variable to hold the texture between the two classes.
I am creating a ToolBar within a wx.Frame init and setting the help string as follows:
def __init_(self,...):
...
self.CreateStatusBar()
tb = self.CreateToolBar(wx.TB_HORIZONTAL|wx.NO_BORDER|wx.TB_FLAT)
tb.SetToolBitmapSize((32,32))
tb.SetSize((-1,132))
tb.AddTool(ID_CLASSIFIER, bmp, shortHelpString='Classifier', longHelpString='Launch Classifier')
...
tb.Realize()
--yet when I mouseover the toolbar icons, the StatusBar does not get updated. I had the same problem when adding PlateButtons to the toobar instead of using AddTool. Does anyone know what I'm doing wrong?
EDIT: Just tested this on Windows and it works. Turns out it's a Mac specific problem. That said, I'm still looking for a solution.
Thanks,
-Adam
I use AddLabelTool in my code and that does show the help text on the status bar:
toolbar.AddLabelTool(self.id, '', bitmap, wx.NullBitmap, self.kind,
shortHelp=wx.MenuItem.GetLabelFromText(self.menuText),
longHelp=self.helpText)