added gwin enabled parameter and implemented button enable/disable functions