Daily Archives

Articles indexed Thursday March 25 2010

Page 18/127 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • making a phone call through asp.net web portal

    - by Prateek Singh
    Hi guys, my landline phone is connected to my computer. Now in my asp.net website there is a textbox and a button . i filled a telephone number in the textbox and on button click i want that a call get connected to the no. in the textbox through my landline phone. Is there any workaround for this in .net framework?? Thanks and best regards.... Prateek

    Read the article

  • How to read a textfile using C#.Net

    - by user203127
    Hi, I have a text file. I want read that file. But In that if the line starts with 6 then i want read that file otherwise leave that line and go to next line. If the line starts with 6 then i want to read that line from position 6 to 15 and 45 to 62. I want to implement this code in C#.NET. How to write that code? Can anyone Help me.

    Read the article

  • PHP regex help with preg_match_all

    - by Steve
    Hi, I am trying to refine a preg_match_all by finding the second occurrence of a period then a space: <?php $str = "East Winds 20 knots. Gusts to 25 knots. Waters a moderate chop. Slight chance of showers."; preg_match_all ('/(^)((.|\n)+?)(\.\s{2})/',$str, $matches); $dataarray=$matches[2]; foreach ($dataarray as $value) { echo $value; } ?> But it does not work: the {2} occurrence is incorrect. I have to use preg_match_all because I a scraping dynamic HTML. I want to capture this from the string: East Winds 20 knots. Gusts to 25 knots. Any ideas? Thx

    Read the article

  • Converting Straight Quotes to Curly Quotes

    - by BlueVoid
    I have an application which uses a javascript based rules engine. I need a way to convert regular straight quotes into curl (or smart) quotes. It'd be easy to just do a string.replace for ["], only this will only insert one case of the curly quote. The best way I could think of was replace the first occurrence of a quote with a left curly quote and every other one following with a left, and the rest right curly. Is there a way to accomplish this using javascript?

    Read the article

  • Why index_merge is not used here using MySQL?

    - by user198729
    Setup: mysql> create table t(a integer unsigned,b integer unsigned); mysql> insert into t(a,b) values (1,2),(1,3),(2,4); mysql> create index i_t_a on t(a); mysql> create index i_t_b on t(b); mysql> explain select * from t where a=1 or b=4; +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | 1 | SIMPLE | t | ALL | i_t_a,i_t_b | NULL | NULL | NULL | 3 | Using where | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ Is there something I'm missing? Update mysql> explain select * from t where a=1 or b=4; +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | 1 | SIMPLE | t | ALL | i_t_a,i_t_b | NULL | NULL | NULL | 1863 | Using where | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ Version: mysql> select version(); +----------------------+ | version() | +----------------------+ | 5.1.36-community-log | +----------------------+

    Read the article

  • Installing CodeIgniter on root and WordPress in sub-directory

    - by maSnun
    Hello, I want to create a website where the main pages will be served from CodeIgniter. I will use Wordpress in the /blog/ sub-directory to host the blog. Thats it! I want nothing else. Just to make sure that: example.com/somepage/ calls a CI controller where as example.com/blog/some-post/ is handled by Wordpress. I don't need any kind of integration or interaction between CI and WP. Is it possible to install in that way? If not, any workarounds so that I can achieve the objectives? Thanks and Regards, Masnun

    Read the article

  • controller path not found for static images? asp.net mvc routing issue?

    - by rksprst
    I have an image folder stored at ~/Content/Images/ I am loading these images via <img src="/Content/Images/Image.png" /> Recently, the images aren't loading and I am getting the following errors in my error log. What's weird is that some images load fine, while others do not load. Anyone have any idea what is wrong with my routes? Am I missing an ignore route for the /Content/ folder? I am also getting the same error for favicon.ico and a bunch of other image files... <Fatal> -- 3/25/2010 2:32:38 AM -- System.Web.HttpException: The controller for path '/Content/Images/box_bottom.png' could not be found or it does not implement IController. at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(Type controllerType) at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) at System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) My current routes look like this: routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); routes.MapRoute( "ControllerDefault", // Route name "{controller}/project/{projectid}/{action}/{searchid}", // URL with parameters new { controller = "Listen", action = "Index", searchid = "" } // Parameter defaults ); Thanks!

    Read the article

  • Event Handlers Not Getting Called? - wxWidgets & C++

    - by Alex
    Hello all, I'm working on a program for my C++ programming class, using wxWidgets. I'm having a huge problem in that my event handlers (I assume) are not getting called, because when I click on the button to trigger the event, nothing happens. My question is: Can you help me find the problem and explain why they would not be getting called? The event handlers OnAbout and OnQuit are working, just not OnCompute or OnClear. I'm really frustrated as I can't figure this out. Thanks a bunch in advance! #include "wx/wx.h" #include "time.h" #include <string> using std::string; // create object of Time class Time first; class App: public wxApp { virtual bool OnInit(); }; class MainPanel : public wxPanel { public: // Constructor for panel class // Constructs my panel class // Params - wxWindow pointer // no return type // pre-conditions: none // post-conditions: none MainPanel(wxWindow* parent); // OnCompute is the event handler for the Compute button // params - none // preconditions - none // postconditions - tasks will have been carried otu successfully // returns void void OnCompute(wxCommandEvent& WXUNUSED(event)); // OnClear is the event handler for the Clear button // params - none // preconditions - none // postconditions - all text areas will be cleared of data // returns void void OnClear(wxCommandEvent& WXUNUSED(event)); // Destructor for panel class // params none // preconditions - none // postconditions - none // no return type ~MainPanel( ); private: wxStaticText *startLabel; wxStaticText *endLabel; wxStaticText *pCLabel; wxStaticText *newEndLabel; wxTextCtrl *start; wxTextCtrl *end; wxTextCtrl *pC; wxTextCtrl *newEnd; wxButton *compute; wxButton *clear; DECLARE_EVENT_TABLE() }; class MainFrame: public wxFrame { private: wxPanel *mainPanel; public: MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size); void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); ~MainFrame(); DECLARE_EVENT_TABLE() }; enum { ID_Quit = 1, ID_About, BUTTON_COMPUTE = 100, BUTTON_CLEAR = 200 }; IMPLEMENT_APP(App) BEGIN_EVENT_TABLE(MainFrame, wxFrame) EVT_MENU(ID_Quit, MainFrame::OnQuit) EVT_MENU(ID_About, MainFrame::OnAbout) END_EVENT_TABLE() BEGIN_EVENT_TABLE(MainPanel, wxPanel) EVT_MENU(BUTTON_COMPUTE, MainPanel::OnCompute) EVT_MENU(BUTTON_CLEAR, MainPanel::OnClear) END_EVENT_TABLE() bool App::OnInit() { MainFrame *frame = new MainFrame( _("Good Guys Delivery Time Calculator"), wxPoint(50, 50), wxSize(450,340) ); frame->Show(true); SetTopWindow(frame); return true; } MainPanel::MainPanel(wxWindow* parent) : wxPanel(parent) { startLabel = new wxStaticText(this, -1, "Start Time:", wxPoint(75, 35)); start = new wxTextCtrl(this, -1, "", wxPoint(135, 35), wxSize(40, 21)); endLabel = new wxStaticText(this, -1, "End Time:", wxPoint(200, 35)); end = new wxTextCtrl(this, -1, "", wxPoint(260, 35), wxSize(40, 21)); pCLabel = new wxStaticText(this, -1, "Percent Change:", wxPoint(170, 85)); pC = new wxTextCtrl(this, -1, "", wxPoint(260, 85), wxSize(40, 21)); newEndLabel = new wxStaticText(this, -1, "New End Time:", wxPoint(180, 130)); newEnd = new wxTextCtrl(this, -1, "", wxPoint(260, 130), wxSize(40, 21)); compute = new wxButton(this, BUTTON_COMPUTE, "Compute", wxPoint(135, 185), wxSize(75, 35)); clear = new wxButton(this, BUTTON_CLEAR, "Clear", wxPoint(230, 185), wxSize(75, 35)); } MainPanel::~MainPanel() {} MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame( NULL, -1, title, pos, size ) { mainPanel = new MainPanel(this); wxMenu *menuFile = new wxMenu; menuFile->Append( ID_About, _("&About...") ); menuFile->AppendSeparator(); menuFile->Append( ID_Quit, _("E&xit") ); wxMenuBar *menuBar = new wxMenuBar; menuBar->Append( menuFile, _("&File") ); SetMenuBar( menuBar ); CreateStatusBar(); SetStatusText( _("Hi") ); } MainFrame::~MainFrame() {} void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(TRUE); } void MainFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox( _("Alex Olson\nProject 11"), _("About"), wxOK | wxICON_INFORMATION, this); } void MainPanel::OnCompute(wxCommandEvent& WXUNUSED(event)) { int startT; int endT; int newEndT; double tD; wxString startTString = start->GetValue(); wxString endTString = end->GetValue(); startT = wxAtoi(startTString); endT = wxAtoi(endTString); pC->GetValue().ToDouble(&tD); first.SetStartTime(startT); first.SetEndTime(endT); first.SetTimeDiff(tD); try { first.ValidateData(); newEndT = first.ComputeEndTime(); *newEnd << newEndT; } catch (BaseException& e) { wxMessageBox(_(e.GetMessage()), _("Something Went Wrong!"), wxOK | wxICON_INFORMATION, this); } } void MainPanel::OnClear(wxCommandEvent& WXUNUSED(event)) { start->Clear(); end->Clear(); pC->Clear(); newEnd->Clear(); }

    Read the article

  • Why a graphics overflow problem as a result of a for loop?

    - by sonny5
    using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Drawing.Imaging; using System.Drawing.Drawing2D; public class Form1 : System.Windows.Forms.Form { public static float WXmin; public static float WYmin; public static float WXmax; public static float WYmax; public static int VXmin; public static int VYmin; public static int VXmax; public static int VYmax; public static float Wx; public static float Wy; public static float Vx; public static float Vy; public Form1() { InitializeComponent(); } private void InitializeComponent() { this.ClientSize = new System.Drawing.Size(400, 300); this.Text="Pass Args"; this.Paint += new System.Windows.Forms.PaintEventHandler(this.doLine); //this.Paint += new System.PaintEventHandler(this.eachCornerPix); //eachCornerPix(out Wx, out Wy, out Vx, out Vy); } static void Main() { Application.Run(new Form1()); } private void doLine(object sender, System.Windows.Forms.PaintEventArgs e) { Graphics g = e.Graphics; g.FillRectangle(Brushes.White, this.ClientRectangle); Pen p = new Pen(Color.Black); g.DrawLine(p, 0, 0, 100, 100); // draw DOWN in y, which is positive since no matrix called eachCornerPix(sender, e, out Wx, out Wy, out Vx, out Vy); p.Dispose(); } private void eachCornerPix (object sender, System.EventArgs e, out float Wx, out float Wy, out float Vx, out float Vy) { Wx = 0.0f; Wy = 0.0f; Vx = 0.0f; Vy = 0.0f; Graphics g = this.CreateGraphics(); Pen penBlu = new Pen(Color.Blue, 2); SolidBrush redBrush = new SolidBrush(Color.Red); int width = 2; // 1 pixel wide in x int height = 2; float [] Wxc = {0.100f, 5.900f, 5.900f, 0.100f}; float [] Wyc = {0.100f, 0.100f, 3.900f, 3.900f}; Console.WriteLine("Wxc[0] = {0}", Wxc[0]); Console.WriteLine("Wyc[3] = {0}", Wyc[3]); /* for (int i = 0; i<3; i++) { Wx = Wxc[i]; Wy = Wyc[i]; Vx = ((Wx - WXmin)*((VXmax-VXmin)+VXmin)/(WXmax-WXmin)); Vy = ((Wy - WYmin)*(VYmax-VYmin)/(WYmax-WYmin)+VYmin); Console.WriteLine("eachCornerPix Vx= {0}", Vx); Console.WriteLine("eachCornerPix Vy= {0}", Vy); g.FillRectangle(redBrush, Vx, Vy, width, height); } */ // What is there about this for loop that will not run? // When the comments above and after the for loop are removed, it gets an overflow? g.Dispose(); } }

    Read the article

  • Accessing local files through an http:// address

    - by RexE
    I would like to access a folder of mp3 files on my local Windows machine through http:// addresses. For example, typing http://localhost:9999/songs/test.mp3 into my browser would play test.mp3, which sits in a specified folder on my C: drive. What is the very simplest way to do this? (Background: a program I'm using wants me to enter the URLs of these files, but assumes they are remote and accessed over http. It doesn't accept URLs of the form file://C/Users.... So, I'd like to give these local files addresses that makes them "look" remote.)

    Read the article

  • Moving Bootcamp partition to another drive

    - by Xster
    Hi, I don't know how sketch this is. I currently have Bootcamp with Windows 7 on my internal along with my Snow Leopard. I'm moving to a bigger harddrive. I'm reinstalling Snow Leopard but I would like to keep my Bootcamp. How do I migrate the data from one drive to another? Any suggestions? I'm not willing to spend money on this

    Read the article

  • WPF Beginner - A simple XAML layout not working as expected

    - by OrWhen
    Hi, I've just started learning WPF, and followed a book to make this sample calculator application in XAML. The XAML code is attached below. I don't have any UI specific code in the xaml.cs file. However, I'm seeing a difference between design time and runtime. As you can see in the attached screenshot, the upper left button of the calculator is bigger than the rest. Even more confusingly, the designer when I edit the XAML shows the button correctly. I've tried to determine why is that, and I'm stumped. Can anyone help? I'm using VS2008, targeting framework 3.5, if it's any help. Here's the XAML: <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" FontSize="24" Name="Header" VerticalAlignment="Center" HorizontalAlignment="Center">Calculator</TextBlock> <TextBox Grid.ColumnSpan="4" Grid.Column="0" Grid.Row="1" Name="Display" HorizontalContentAlignment="Left" Margin="5" /> <Button Grid.Row="2" Grid.Column="0" Click="Button_Click">7</Button> <Button Grid.Row="2" Grid.Column="1" Click="Button_Click">8</Button> <Button Grid.Row="2" Grid.Column="2" Click="Button_Click">9</Button> <Button Grid.Row="3" Grid.Column="0" Click="Button_Click">4</Button> <Button Grid.Row="3" Grid.Column="1" Click="Button_Click">5</Button> <Button Grid.Column="2" Grid.Row="3" Click="Button_Click">6</Button> <Button Grid.Row="4" Grid.Column="0" Click="Button_Click">1</Button> <Button Grid.Row="4" Grid.Column="1" Click="Button_Click">2</Button> <Button Grid.Row="4" Grid.Column="2" Click="Button_Click">3</Button> <Button Grid.Row="5" Grid.Column="0" Click="Button_Click">0</Button> <Button Grid.Row="5" Grid.Column="3" Tag="{x:Static local:Operation.PLUS}" Click="Op_Click">+</Button> <Button Grid.Row="4" Grid.Column="3" Tag="{x:Static local:Operation.MINUS}" Click="Op_Click">-</Button> <Button Grid.Row="3" Grid.Column="3" Tag="{x:Static local:Operation.TIMES}" Click="Op_Click">*</Button> <Button Grid.Row="2" Grid.Column="3" Tag="{x:Static local:Operation.DIVIDE}" Click="Op_Click">/</Button> <Button Grid.Row="5" Grid.Column="1" >.</Button> <Button Grid.Row="5" Grid.Column="2" Tag="{x:Static local:Operation.EQUALS}" Click="Op_Click">=</Button> </Grid>

    Read the article

  • How does extern work in c++?

    - by symfony
    This is from the <iostream>: namespace std { extern istream cin; ///< Linked to standard input extern ostream cout; ... It seems by using extern the data types defined in other namespaces will just be available?

    Read the article

  • Regarding parser DOM and REGEX

    - by giri
    Hi I am writing an application in java I need to fetch specific data from website.I do not know which one to use whether REGEX or Parser.Can anybody please advise me how to get this done? and which one is prefered. Thanks

    Read the article

  • Can I add elements to a Java GUI?

    - by Asj
    I want to know how I can make a java program where an unknown amount of objects can be added to a GUI depending on user input. I can program in objects one at a time within the program, but I haven't seen a more dynamic program. Can I do that with Java? If not, what can I do it with? For more information, here's a picture. http://i6.photobucket.com/albums/y223/Asj127/CapProjIdea.jpg There can be more than one question per question block, and each question can have it's own question block.

    Read the article

  • display image in a grid using extjs

    - by Abisha
    I am new to extjs. I want to display icon images for each grid elements. can you please healp me anybody? i am getting the image path from an xml file. my code is below. here i am displaying image path. i have to replace it by displaying image. Ext.onReady(function(){ var store = new Ext.data.Store({ url: 'new_frm.xml', reader: new Ext.data.XmlReader({ record: 'message', fields: [{name: 'first'},{name: 'last'},{name: 'company'},{name: 'email'},{name: 'gender'},{name: 'form-file'},{name: 'state'},{name: 'Live'},{name: 'content'}] }) }); var grid = new Ext.grid.GridPanel({ store: store, columns: [ {header: "First Name", width: 120, dataIndex: 'first', sortable: true}, {header: "Last Name", width: 180, dataIndex: 'last', sortable: true}, {header: "Company", width: 115, dataIndex: 'company', sortable: true}, {header: "Email", width: 100, dataIndex: 'email', sortable: true}, {header: "Gender", width: 100, dataIndex: 'gender', sortable: true}, {header: "Photo", width: 100, dataIndex: 'form-file', sortable: true}, {header: "State", width: 100, dataIndex: 'state', sortable: true}, {header: "Living with", width: 100, dataIndex: 'Live', sortable: true}, {header: "Commands", width: 100, dataIndex: 'content', sortable: true} ], renderTo:'example-grid', height:200 }); store.load(); });

    Read the article

  • Ruby on Rails export to csv - maintain mysql select statement order

    - by zekial
    Exporting some data from mysql to a csv file using FasterCSV. I'd like the columns in the outputted CSV to be in the same order as the select statement in my query. Example: rows = Data.find( :all, :select=>'name, age, height, weight' ) headers = rows[0].attributes.keys FasterCSV.generate do |csv| csv << headers rows.each do |r| csv << r.attributes.values end end CSV Output: height,weight,name,age 74,212,bob,23 70,201,fred,24 . . . I want the CSV columns in the same order as my select statement. Obviously the attributes method is not going to work. Any ideas on the best way to ensure that the columns in my csv file will be in the same order as the select statement? Got a lot of data and performance is an issue. The select statement is not static. I realize I could loop through column names within the rows.each loop but it seems kinda dirty.

    Read the article

  • Problem deploying GWT project with a servlet that invoke an EJB

    - by bovo
    I have a simple GWT project in Eclipse, it has a servlet that calls an EJB and everything works fine when I run it in hosted mode from Eclipse. MyProject +- src +- JRE System Library +- GWT SDK +- Apache Geronimo v2.2 +- myEJB.jar +- openejb.jar -- war -- +- images -- +- myproject -- +- WEB-INF I'm not sure what is the best way to deploy it, but what I did is create a .war file from the "war" folder of the project then deploy it to the server. Communication between client and server works fine but I get an error when I try to do JNDI look up for the EJB within the servlet. The error I get is something like "JNDI error, cannot find FooManagerRemote" Things works fine in hosted mode so I'm pretty sure that I din't deploy it correctly.

    Read the article

  • Event Handlers Not Getting Called? - wxWidgets

    - by Alex
    Hello all, I'm working on a program for my C++ programming class, using wxWidgets. I'm having a huge problem in that my event handlers (I assume) are not getting called, because when I click on the button to trigger the event, nothing happens. My question is: Can you help me find the problem and explain why they would not be getting called? The event handlers OnAbout and OnQuit are working, just not OnCompute or OnClear. I'm really frustrated as I can't figure this out. Thanks a bunch in advance! #include "wx/wx.h" #include "time.h" #include <string> using std::string; // create object of Time class Time first; class App: public wxApp { virtual bool OnInit(); }; class MainPanel : public wxPanel { public: // Constructor for panel class // Constructs my panel class // Params - wxWindow pointer // no return type // pre-conditions: none // post-conditions: none MainPanel(wxWindow* parent); // OnCompute is the event handler for the Compute button // params - none // preconditions - none // postconditions - tasks will have been carried otu successfully // returns void void OnCompute(wxCommandEvent& WXUNUSED(event)); // OnClear is the event handler for the Clear button // params - none // preconditions - none // postconditions - all text areas will be cleared of data // returns void void OnClear(wxCommandEvent& WXUNUSED(event)); // Destructor for panel class // params none // preconditions - none // postconditions - none // no return type ~MainPanel( ); private: wxStaticText *startLabel; wxStaticText *endLabel; wxStaticText *pCLabel; wxStaticText *newEndLabel; wxTextCtrl *start; wxTextCtrl *end; wxTextCtrl *pC; wxTextCtrl *newEnd; wxButton *compute; wxButton *clear; DECLARE_EVENT_TABLE() }; class MainFrame: public wxFrame { private: wxPanel *mainPanel; public: MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size); void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); ~MainFrame(); DECLARE_EVENT_TABLE() }; enum { ID_Quit = 1, ID_About, BUTTON_COMPUTE = 100, BUTTON_CLEAR = 200 }; IMPLEMENT_APP(App) BEGIN_EVENT_TABLE(MainFrame, wxFrame) EVT_MENU(ID_Quit, MainFrame::OnQuit) EVT_MENU(ID_About, MainFrame::OnAbout) END_EVENT_TABLE() BEGIN_EVENT_TABLE(MainPanel, wxPanel) EVT_MENU(BUTTON_COMPUTE, MainPanel::OnCompute) EVT_MENU(BUTTON_CLEAR, MainPanel::OnClear) END_EVENT_TABLE() bool App::OnInit() { MainFrame *frame = new MainFrame( _("Good Guys Delivery Time Calculator"), wxPoint(50, 50), wxSize(450,340) ); frame->Show(true); SetTopWindow(frame); return true; } MainPanel::MainPanel(wxWindow* parent) : wxPanel(parent) { startLabel = new wxStaticText(this, -1, "Start Time:", wxPoint(75, 35)); start = new wxTextCtrl(this, -1, "", wxPoint(135, 35), wxSize(40, 21)); endLabel = new wxStaticText(this, -1, "End Time:", wxPoint(200, 35)); end = new wxTextCtrl(this, -1, "", wxPoint(260, 35), wxSize(40, 21)); pCLabel = new wxStaticText(this, -1, "Percent Change:", wxPoint(170, 85)); pC = new wxTextCtrl(this, -1, "", wxPoint(260, 85), wxSize(40, 21)); newEndLabel = new wxStaticText(this, -1, "New End Time:", wxPoint(180, 130)); newEnd = new wxTextCtrl(this, -1, "", wxPoint(260, 130), wxSize(40, 21)); compute = new wxButton(this, BUTTON_COMPUTE, "Compute", wxPoint(135, 185), wxSize(75, 35)); clear = new wxButton(this, BUTTON_CLEAR, "Clear", wxPoint(230, 185), wxSize(75, 35)); } MainPanel::~MainPanel() {} MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame( NULL, -1, title, pos, size ) { mainPanel = new MainPanel(this); wxMenu *menuFile = new wxMenu; menuFile->Append( ID_About, _("&About...") ); menuFile->AppendSeparator(); menuFile->Append( ID_Quit, _("E&xit") ); wxMenuBar *menuBar = new wxMenuBar; menuBar->Append( menuFile, _("&File") ); SetMenuBar( menuBar ); CreateStatusBar(); SetStatusText( _("Hi") ); } MainFrame::~MainFrame() {} void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(TRUE); } void MainFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox( _("Alex Olson\nProject 11"), _("About"), wxOK | wxICON_INFORMATION, this); } void MainPanel::OnCompute(wxCommandEvent& WXUNUSED(event)) { int startT; int endT; int newEndT; double tD; wxString startTString = start->GetValue(); wxString endTString = end->GetValue(); startT = wxAtoi(startTString); endT = wxAtoi(endTString); pC->GetValue().ToDouble(&tD); first.SetStartTime(startT); first.SetEndTime(endT); first.SetTimeDiff(tD); try { first.ValidateData(); newEndT = first.ComputeEndTime(); *newEnd << newEndT; } catch (BaseException& e) { wxMessageBox(_(e.GetMessage()), _("Something Went Wrong!"), wxOK | wxICON_INFORMATION, this); } } void MainPanel::OnClear(wxCommandEvent& WXUNUSED(event)) { start->Clear(); end->Clear(); pC->Clear(); newEnd->Clear(); }

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >