+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 21 to 35 of 35

Follow me creating my first M8 app

This is a discussion on Follow me creating my first M8 app within the Modding & Development forums, part of the Meizu M8 category; Originally Posted by Err0r Aha, no. I want to write plain text. Do you know the command? Did you install ...

  1. #21
    Senior Member
    Join Date
    Nov 2009
    Location
    Germany
    Posts
    409
    Thanks
    69
    Thanked 37 Times in 19 Posts
    Quote Originally Posted by Err0r View Post
    Aha, no. I want to write plain text. Do you know the command? Did you install VS2008 yet?

    I guess the commands beginning with "m_" are defined somewhere? Where?
    iīll install it in the evening...

    ...i donīt realy know what you mean with plain text...do you want to input a text somewhere? In an button or element?
    Last edited by Stopthewar; 02-11-2010 at 08:43 AM.

  2. #22
    Founder
    Join Date
    Nov 2006
    Location
    Stockholm
    Posts
    2,876
    Thanks
    133
    Thanked 261 Times in 77 Posts
    No button, just regular text. Like when you go to Settings > About > Legal.
    Can't wait to play with the Meizu MX!

  3. #23
    Senior Member
    Join Date
    Nov 2009
    Location
    Germany
    Posts
    409
    Thanks
    69
    Thanked 37 Times in 19 Posts
    Quote Originally Posted by Err0r View Post
    No button, just regular text. Like when you go to Settings > About > Legal.
    i canīt help you now...sorry...but try using a label...insert it in the app....then make something like...label.setText("xyz"); maybe it works

  4. #24
    Moderator
    Join Date
    Mar 2008
    Location
    Germany
    Posts
    1,723
    Thanks
    96
    Thanked 358 Times in 141 Posts
    is a caption enough?
    Google Translate
    [Meizu M8 - FAQ] [Meizu M9 Tips and Tricks]

    No Support over PM. Please use the Forum.

  5. #25
    Senior Member
    Join Date
    Sep 2009
    Posts
    380
    Thanks
    3
    Thanked 138 Times in 53 Posts
    followers+=1
    int followers = 0; //Donīt forget that
    Do it the C++ way...
    followers++;

    This things with m_ or most likly no commands. These are variables and the m_ is added so show that it is a member variable. This means this belongs to a class.
    You cant write plain text. You need to create and insert a label object first and then set text.
    Count me to helpers

    int helpers;
    helpers+=2; //crimson and me lol
    Or really geek way (and to show what a member variable is
    Code:
    enum E_Role
    {
        learner = 0,
        helper
    };
    
    class cForumMembers
    {
        std::string m_Name;
        E_Role m_Role;
    public:
        cForumMembers(std::string xName)
        {
            this->m_Name = xName;
        }
    };
    
    class cLearner : public ForumMembers
    {
    public:
        cLearner(std::string xName) 
        : cForumMembers(xName)
        {
            this->m_Role = learner;
        }     
    
    };
    
    class cHelper : public ForumMembers
    {
    public:
        cHelper(std::string xName) 
        : cForumMembers(xName)
        {
            this->m_Role = helper;
        }     
    
    };
    
    
    int main()
    {
        std::vector<cForumMembers> vPeople;
    
        vPeople.push_back(new cLearner("Error"));
        vPeople.push_back(new cHelper("Crimson"));
        vPeople.push_back(new cHelper("r3wDy"));
        
    }
    Last edited by r3wDy; 02-11-2010 at 11:30 AM.

  6. #26
    Member
    Join Date
    Jul 2009
    Posts
    226
    Thanks
    34
    Thanked 83 Times in 30 Posts
    use UiCaption, like crimson05 said above.

    1. declare a memeber in header file
    Code:
    UiCaption m_text;
    2. in the implementation cpp file. in method, OnInitDialog,
    Code:
    m_text.SetPos(10, 10, GetWidth(), MZM_HEIGHT_CAPTION); // to whereever you like, MZM_HEIGHT_CAPTION is a predefined value in SDK
    m_text.SetTextColor(RGB(128, 20, 55)); // the text colour for whatever you like
    m_text.SetText(_T("This is a demo"));
    AddUiWin(&m_text);
    the code above should work, but i haven't tested it

  7. #27
    Junior Member
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    68
    Thanks
    14
    Thanked 2 Times in 1 Post
    @Err0r:

    For the case You need it - if You try to create an edit Field (UiEdit), don't declare it as a pointer like it is wirtten in an example in the SDK documentation:

    Code:
    UiEdit* m_edit;
    Visual Studio will say that You have to use a -> to access a class structure (which is totally right). The problem is, that the application crashes when trying to add this class to its parent:

    Code:
    AddUiWin(&m_edit);
    Instead, declare UiEdit as any other UI-component (without *).

    Maybe Visual Studio won't agree with that and won't show it's Intelli-Sense feature, but on the M8 it will work fine.

    PS: If You are looking for more code examples, try Google Code Search.

  8. #28
    Senior Member
    Join Date
    Sep 2009
    Posts
    380
    Thanks
    3
    Thanked 138 Times in 53 Posts
    AddUiWin(&m_edit);
    This must crash ur application. Cause adding * you create a pointer, and callind addwin this way gives the adress of the pointer to the function (a pointer to a pointer).
    Just call
    AddUiWin(m_edit);
    if m_edit is already a pointer

    But anyway this is just geeking around we will confuse error more than we help

  9. #29
    Junior Member
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    68
    Thanks
    14
    Thanked 2 Times in 1 Post
    Quote Originally Posted by r3wDy View Post
    This must crash ur application. Cause adding * you create a pointer, and callind addwin this way gives the adress of the pointer to the function (a pointer to a pointer).
    Exactly. I just want to share this information with you because in one (the only one) example in the SDK documentation is imho wrong, because there it's initialized as a pointer (since there are many people just learning the SDK out of code examples)

    Currently I'm stuck in setting an align to a UiStatic class. All my text fields come with centered text. Any suggestions?

  10. #30
    Founder
    Join Date
    Nov 2006
    Location
    Stockholm
    Posts
    2,876
    Thanks
    133
    Thanked 261 Times in 77 Posts
    Another thing. How do you create an image that covers the entire background? SetPos(0,0,...) still creates some space above and to the left of the image.
    Can't wait to play with the Meizu MX!

  11. #31
    Senior Member
    Join Date
    Nov 2009
    Location
    Germany
    Posts
    409
    Thanks
    69
    Thanked 37 Times in 19 Posts
    Quote Originally Posted by Err0r View Post
    Aha, no. I want to write plain text. Do you know the command? Did you install VS2008 yet?

    I guess the commands beginning with "m_" are defined somewhere? Where?
    try 18_uisetpassdown example ...this should help

  12. #32
    Moderator
    Join Date
    Mar 2008
    Location
    Germany
    Posts
    1,723
    Thanks
    96
    Thanked 358 Times in 141 Posts
    Google Translate

    MzDrawText
    [Meizu M8 - FAQ] [Meizu M9 Tips and Tricks]

    No Support over PM. Please use the Forum.

  13. #33
    Founder
    Join Date
    Nov 2006
    Location
    Stockholm
    Posts
    2,876
    Thanks
    133
    Thanked 261 Times in 77 Posts


    I've decided for my first app to be a fart app. It will contain functions such as fart selection, timed farts and fart recording.

    I've attached version 0.1, and a lot of code is borrowed from crimson05's SoundBox app.

    To try it out, make a folder and extract to: \\Disk\Programs\FartBot\
    Attached Files
    Last edited by Err0r; 02-17-2010 at 04:51 PM.
    Can't wait to play with the Meizu MX!

  14. Member who thanked Err0r for the post:


  15. #34
    Valued Member
    Join Date
    Mar 2009
    Location
    Vienna, Austria
    Posts
    1,706
    Thanks
    54
    Thanked 269 Times in 146 Posts
    What a funny idea - congrats !!!

  16. #35
    Junior Member
    Join Date
    Aug 2009
    Posts
    61
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Err0r View Post
    text
    Haha Awesomeness!


 

Similar Threads

  1. Creating modified xip.bin
    By cybermessiah in forum Modding & Development
    Replies: 7
    Last Post: 01-28-2010, 03:02 PM
  2. Replies: 1
    Last Post: 06-03-2009, 03:36 AM
  3. [Follow Me]How To:Use DFU tools
    By Da_Vinci in forum Technical
    Replies: 20
    Last Post: 07-15-2008, 08:16 AM
  4. Creating Music Folders
    By Stimpeh in forum Technical
    Replies: 2
    Last Post: 11-14-2007, 10:32 AM
  5. Need help creating a DVD from these files.
    By Borat in forum General Chat
    Replies: 0
    Last Post: 10-07-2007, 12:56 PM