• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Morya

            自己寫的小工具,本來是用perl寫的命令行版本

            支持 shutdown -s -t 3h20m 類似的東西

            后來還是覺得打命令麻煩……
            干脆,造了一個GUI的。

            (*貌似zoundry的上傳在cppblog不好用,或者是我不會設(shè)置。。 我一直以為有圖片了……)

            shut.7z

            posted @ 2009-05-21 14:51 Morya 閱讀(290) | 評論 (0)編輯 收藏
            wxStandardPaths().GetDataDir()

            這個函數(shù)可以用來非常方便的取得exe的位置。(Manual)

            可是用vc編譯的debug版卻沒有包含最后的debug目錄。
            很是疑惑啊!
            以為vc添加了什么神奇的東西。
            看了
            wxStandardPaths::GetDataDir() 的源代碼,
            1 wxString wxStandardPaths::GetDataDir() const
            2 {
            3    // under Windows each program is usually installed in its own directory and
            4    // so its datafiles are in the same directory as its main executable
            5    return GetAppDir();
            6 }

             1 wxString wxStandardPaths::GetAppDir()
             2 {
             3    wxFileName fn(wxGetFullModuleName());
             4 
             5    // allow running the apps directly from build directory in debug builds
             6 #ifdef __WXDEBUG__
             7    wxString lastdir;
             8    if ( fn.GetDirCount() )
             9    {
            10       lastdir = fn.GetDirs().Last();
            11       lastdir.MakeLower();
            12       if ( lastdir.Matches(_T("debug*")) || lastdir.Matches(_T("vc_msw*")) )
            13       fn.RemoveLastDir();
            14    }
            15 }
            16 

            posted @ 2009-04-12 20:27 Morya 閱讀(607) | 評論 (0)編輯 收藏
                 摘要: ::wxGetTranslation()

            const wxChar * wxGetTranslation(const wxChar* str, const wxChar* domain = NULL)

            const wxChar * wxGetTranslation(const wxChar* str, const wxChar* strPlural, size_t n, const wxChar* domain = NULL)

            This function returns the translation of string str in the current locale. If the string is not found in any of the loaded message catalogs (see internationalization overview), the original string is returned. In debug build, an error message is logged -- t  閱讀全文
            posted @ 2008-12-24 14:24 Morya 閱讀(1051) | 評論 (1)編輯 收藏
                 摘要: 當(dāng)Adobe、Microsoft、Sun等一系列巨頭開始表現(xiàn)出對”開源”的青睞時,”開源”的時代即將到來!

            最初來自:http://www.sinoprise.com/read.php?tid-662-page-e-fpage-1.html(遺憾的是這個鏈接已經(jīng)打不開了),我基本未改動,只是進(jìn)行了一些排版和整理。
            參考文獻(xiàn):http://www.fsf.org/licensing/licenses/

            現(xiàn)今存在的開源協(xié)議很多,而經(jīng)過Open Source Initiative組織通過批準(zhǔn)的開源協(xié)議目前有58種(http://www.opensource.org/licenses/alphabetical)。我們在常見的開源協(xié)議如BSD, GPL, LGPL,MIT等都是OSI批準(zhǔn)的協(xié)議。如果要開源自己的代碼,最好也是選擇這些被批準(zhǔn)的開源協(xié)議。

            這里我們來看四種最常用的開源協(xié)議及它們的適用范圍,供那些準(zhǔn)備開源或者使用開源產(chǎn)品的開發(fā)人員/廠家參考。

              閱讀全文
            posted @ 2008-12-10 20:42 Morya 閱讀(280) | 評論 (2)編輯 收藏

            突然覺得,是時候該轉(zhuǎn)變一下視角了。 圖片《灰色的城市》以后就是我的桌面。

            城市.png

            posted @ 2008-11-21 21:14 Morya 閱讀(170) | 評論 (0)編輯 收藏
            A wxPaintDC must be constructed if an application wishes to paint on the client area of a window from within an EVT_PAINT() event handler. This should normally be constructed as a temporary stack object; don't store a wxPaintDC object. If you have an EVT_PAINT() handler, you must create a wxPaintDC object within it even if you don't actually use it.

            如果使用EVT_PAINT()分配paint事件處理函數(shù),一定要在處理函數(shù)里創(chuàng)建一個wxPaintDC臨時變量。否則程序會Halt。
            posted @ 2008-11-05 17:06 Morya 閱讀(265) | 評論 (0)編輯 收藏
            看到wxWidgets可以靜態(tài)事件編程,也可以動態(tài)事件編程 但是我編寫動態(tài)事件的時候,還是需要編寫一個enum 用來分配ID,畢竟沒有ID就沒法分配事件 偶然看到wxWindow的定義,才發(fā)現(xiàn)有一個GetID()可以用。 這樣就方便多了。

            wxButton * btn = new wxButton( this, wxID_ANY, wxT("Btn") );
            Connect( btn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainWin::OnBtnClicked) );
            posted @ 2008-11-04 22:03 Morya 閱讀(188) | 評論 (0)編輯 收藏
            class MainWin: public wxFrame;
            無法通過
            MainWin::MainWin(){
            SetWindowStyleFlag(GetWindowStyleFlag() & ~wxCLOSE_BOX);
            }
            奏效,必須在構(gòu)造函數(shù)中傳入
            MainWin::MainWin(const wxString & title):
            wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE 
            & ~( wxMAXIMIZE_BOX | wxCLOSE_BOX)) {;}


            posted @ 2008-11-04 22:02 Morya 閱讀(312) | 評論 (0)編輯 收藏
            編譯其實很簡單,

            下面這行,就可以實現(xiàn)。

            nmake /f makefile.vc share=1
            或者編輯config.* 文件。

            編寫程序,調(diào)用的引用庫地址從 c:\wxwidgets-2.8.7\lib\vc_lib 換成 c:\wxwidgets-2.8.7\lib\vc_dll
            只有一個要注意的事情 編譯選項里
            加上一個 WXUSINGDLL 預(yù)處理。
            posted @ 2008-11-04 21:56 Morya 閱讀(558) | 評論 (0)編輯 收藏

            文件在OnInit()函數(shù)中可以自定義處理命令行解析。

            文件 $(wxWidgetsDIR)\src\common\appbase.cpp

            class WXDLLIMPEXP_BASE wxAppConsole : public wxEvtHandler
            {
            public:
            /*
            .
            .
            .
            */
                
            // Called before OnRun(), this is a good place to do initialization -- if
                
            // anything fails, return false from here to prevent the program from
                
            // continuing. The command line is normally parsed here, call the base
                
            // class OnInit() to do it.
                virtual bool OnInit();
            };

            否則,則可以在

            bool TheApp::OnInit(){
               
            if(!wxApp::OnInit()) return false;
            // ..
            // ..
            }

            可以在自己的OnInit()函數(shù)中自己處理命令行。

            class TheApp : public wxApp{
            public:
               TheApp();
               
            virtual bool OnInit();
               
            virtual int OnRun();
               
            virtual void OnCmdLineParsed();
            };

            TheApp::OnInit(){
              
            cmdParser.SetCmdLine( argc, argv);
            bool cont;
            cont 
            = false;
            OnInitCmdLine( cmdParser );

            switch ( int parseResult = cmdParser.Parse( false /* don't show usage */) ){
               
            case -1:// show usage message
                cont = false;
                
            break;
               
            case 0// normal parsed
                cont = OnCmdLineParsed( cmdParser);
                
            break;
               
            default// parsed error
                cont = false;// OnCmdLineError( cmdParser);
                break;
            }
            if!cont){
               
            return false;
            }

            posted @ 2008-11-04 21:53 Morya 閱讀(443) | 評論 (0)編輯 收藏
            僅列出標(biāo)題
            共3頁: 1 2 3 

            導(dǎo)航

            <2025年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            統(tǒng)計

            常用鏈接

            留言簿(1)

            隨筆檔案(21)

            文章檔案(1)

            最新評論

            評論排行榜

            99久久精品免费看国产一区二区三区| 久久国产精品免费| 亚洲中文久久精品无码| 日韩精品久久久久久久电影蜜臀 | 日日躁夜夜躁狠狠久久AV| 97久久国产亚洲精品超碰热| 久久99精品九九九久久婷婷| 久久久久亚洲AV无码专区首JN| 国产精品福利一区二区久久| 久久久精品久久久久久| 午夜精品久久久久久99热| 久久精品国产亚洲Aⅴ蜜臀色欲 | 99久久婷婷国产一区二区| 久久久久久久免费视频| 国产91色综合久久免费分享| 国产99久久久国产精品小说| 国产成人99久久亚洲综合精品| 色婷婷综合久久久久中文一区二区 | 色综合色天天久久婷婷基地| 超级碰碰碰碰97久久久久| 国产精品99久久久久久www| 婷婷综合久久中文字幕蜜桃三电影 | 欧美日韩精品久久久久| 久久99精品国产麻豆婷婷| WWW婷婷AV久久久影片| 亚洲女久久久噜噜噜熟女| 日韩欧美亚洲国产精品字幕久久久| 久久精品一区二区国产| 久久天天躁狠狠躁夜夜躁2O2O| 久久精品中文无码资源站| 要久久爱在线免费观看| 久久人人超碰精品CAOPOREN | 久久精品中文字幕大胸| 久久综合九色欧美综合狠狠| 久久本道综合久久伊人| 久久精品免费大片国产大片| 久久国产精品无码网站| 亚洲欧洲久久av| 久久天天躁夜夜躁狠狠| 亚洲中文字幕无码久久精品1| 久久SE精品一区二区|