How to add new UI to cocos2d-x library - user-interface

I have a question about adding new UI widget (in my case its an EditBox but with UIEditView instead of UIEditBox). I make some changes to UIEditBox, named it UIEditView and put into UI folder. Add all the files to the new created group
Included it in CocosGUI.h, but still can not use it.
Here the default list
Both Classes in my UIEditView have unique names
Names of classes
So what wong? ;(
Thanks in advice

I can't see the entire class, but from what I can see if you just try to access ui::UIEditBox without cocos2d in front of it, it might work. If that's not the case make sure you have NS_CC_BEGIN or using namepace cocos2d in your header and cpp file.
Also you don't have to add your custom ui into the cocos ui folders, unless you want to push it back to to project. Otherwise I have a folder for CustomUI that I host on GitHub as a opensource project so others can use it. Just makes it easier to manage.
If this did not help can you please post more of your files, if you don't mind sharing, will make it easier to help you.

Related

Joomla cannot unset mod_languages/css/template.css

Joomla 3.x
The following code is not working
unset($doc->_styleSheets[JURI::root(true).'/media/mod_languages/css/template.css']);
thank you
The code is correct and I tested it, it's working fine.
Possibly you are running it in a plugin event after the head is rendered, or you have cached the page and the code is not really running.
In either case, try to put it at the component level, clear cache, and it should work
Update
to identify the component: turn SEF off, and look at the URL it shows as option=com_componentname;
to identify the module, simply rename the modules folder, and update the site; if it works, it's a module.
For plugins, rename the plugins/system and plugins/content first, then drill down until you spot it.
Alternatively, but much slower, you can turn modules and plugins on and off from the backend, until you find the culprit.
A variation which I've used with success in the past:
unset($doc->_styleSheets[$this->baseurl.'/media/mod_languages/css/template.css']);
Update
Here's an alternate method using a module override which should work for you.
if it doesn't already exist, create a new directory titled html in your template's folder, ie: /templates/your-template/html/
inside this, create an new mod_languages folder, ie /templates/your-template/html/mod_languages/
copy the file from joomla-site-root/modules/mod_languages/tmp/default.php to the folder above, ie /templates/your-template/html/mod_languages/default.php
open this file with a text editor and around line 12 look for the line where JHtml is loading the mod_languages CSS, and comment it out.
// JHtml::_('stylesheet', 'mod_languages/template.css', array(), true);
That's it, hopefully, this will do the trick for you.
Overriding Joomla core output using this method is safe and you won't loose your work with future Joomla updates.
More info about Joomla overrides:
https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
Good luck!

Local.xml change or only adding files?

I found out, that frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml
does control the parts of my bundle-pages that I want to edit. So, alright I could edit this file directly but I learnt, that isn't recommended due to upgradability-problems.
So, what would I alternatively need to do? Do I just need to add a new file
frontend/my_package/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml
like this and put all my stuff in there, or do I also need to reference something into my layout within local.xml? How would I do that?
Thanks
So yes simply make this file in your theme and then you can edit it to fit with your design.
The other option which is a bit more complex is to update the template via some layout xml and then this new template will be used and you can add it to the base folder with whatever new path you like. I would suggest that your changes are probably theme specific and so should be made by making the changes in your theme.

Events are disabled in codenameone

I have problem when I want to access events. I already copied the resource files (nativej2me.res) under src directory but still the events are disabled within my project.
Can anyone help me how to arrange the resources so it enables the vents..?
Thanks
Don't move that resource file. Its not the place for it.
I'm guessing you created a handcoded application where GUI builder events aren't supported. You need to create a GUI builder project when creating a new project.
That's a GUI builder project (notice the visual not manual in the brackets)
Just for the googlers out there:
Have a look in the file codenameone_settings.properties - in there you'll find the property userClassAbs=something/StateMachine.java
Its an absolute path and it was showing the wrong directory. After fixing this I was able to add Events in the Designer again.

Importing Another Cocos2d Project's Classes, Code, and SRC

The project I was toying around with for some reason was a dated version of cocos2d, and the classes and methods I was trying to introduce were too recent. So, I have successfully installed the new cocos2d, and have created a cocos2d template in Xcode. My issue is that this project is brand new, and I want to bring all my other project's code into this.
I have searched this across other stackoverflow threads, and just dragged the files/folder into the new project. When the files wouldn't transfer, I adjusted their path, and then dragged them in, or in one unique case, when dealing with the class main.m, I just changed its internal code so that it would sync up with the rest of the code.
However, because this is a template file, there are some extra baggage classes that I am not sure how to handle. These classes are the classes that come standard in the 'Classes' folder when the cocos2d template is first created:
GameConfig.h
HelloWorldLayer.h
HelloWorldLayer.m
RootViewController.h
RootViewController.m
MyGameAppDelegate.h
MyGameAppDelegate.m
And then in the 'Other Sources' folder:
MyGame_Prefix.pch
These classes or their likeness does not appear to be used in the original project from which I copied the other classes, is there any special use for them that would be dangerously stupid for me to delete them?
You can delete HelloWorldLayer. It's just the example scene/layer.
You would do well to leave the other files in. Any modifications you may have made to your old project's app delegate (such as which scene is passed to CCDirector's runWithScene method) should be re-done in the MyGameAppDelegate rather than replacing that with your old project's app delegate.
The reason is that the startup sequence for cocos2d has changed to support Retina devices, autorotation, changes in the iOS SDK, etc. The RootViewController handles autorotation, should you need that. Whether autorotation is enabled or not can be changed via GameConfig.h.

How to create multiple project template in one solution for windows phone

in the normal wp7 app, there is only one project. I try to add another project into an existing solution. however, it could not run. I think it is possible to add more than one project templates into existing solution. But I just dont know what need to be done or what files need to be deleted. woud appreciate your help on this.
----- Update ---
Create two projects; ProjMain and ProjChild
In projChild, add a new Page and delete App.xaml, MainPage.Xaml,AppManifest.xml, WMAppManifest.xml, ApplicationIcon.png, Background.png
3 In ProjMain, I add ProjChild into this ProjMain.
Yes, it is possible to add multiple projects under a solution. To the main project you want to build, you need to add references of the other projects to it. Each project, however, needs to be error free and compile on its own. Check the build output for errors.
Yes we can switch one project to another. We have a need to add reference of that project.
then use NavigationService like.
NavigationService.Navigate(new Uri("/AnotherProject;component/Page2.xaml", UriKind.Relative));
here AnotherProject is second project from where we want to use new page and page name.

Resources