Ejemplo n.º 1
0
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
                            const wxPoint& pos, const wxSize& size,
                            const wxArrayString& choices,
                            long style,
                            const wxValidator& validator, const wxString& name)
{
    wxCArrayString chs(choices);
    return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(),
                  style, validator, name);
}
Ejemplo n.º 2
0
bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
                        const wxPoint& pos, const wxSize& size,
                        const wxArrayString& choices,
                        int majorDim, long style,
                        const wxValidator& val, const wxString& name)
{
    wxCArrayString chs(choices);
    return Create(parent, id, title, pos, size, chs.GetCount(),
                  chs.GetStrings(), majorDim, style, val, name);
}
Ejemplo n.º 3
0
bool wxMultiChoiceDialog::Create( wxWindow *parent,
                                  const wxString& message,
                                  const wxString& caption,
                                  const wxArrayString& choices,
                                  long style,
                                  const wxPoint& pos )
{
    wxCArrayString chs(choices);
    return Create( parent, message, caption, chs.GetCount(),
                   chs.GetStrings(), style, pos );
}
Ejemplo n.º 4
0
wxCheckListBox::wxCheckListBox ( wxWindow* pParent,
                                 wxWindowID vId,
                                 const wxPoint& rPos,
                                 const wxSize& rSize,
                                 const wxArrayString& asChoices,
                                 long lStyle,
                                 const wxValidator& rVal,
                                 const wxString& rsName )
               :wxCheckListBoxBase()
{
    wxCArrayString chs(asChoices);
    Create( pParent, vId, rPos, rSize, chs.GetCount(), chs.GetStrings(),
            lStyle | wxLB_OWNERDRAW, rVal, rsName );
} // end of wxCheckListBox::wxCheckListBox
Ejemplo n.º 5
0
bool wxChoice::Create(
  wxWindow*                         pParent
, wxWindowID                        vId
, const wxPoint&                    rPos
, const wxSize&                     rSize
, const wxArrayString&              asChoices
, long                              lStyle
, const wxValidator&                rValidator
, const wxString&                   rsName
)
{
    wxCArrayString chs(asChoices);

    return Create(pParent, vId, rPos, rSize, chs.GetCount(), chs.GetStrings(),
                  lStyle, rValidator, rsName);
}
Ejemplo n.º 6
0
void
BucketHandler::performSetCurrentState(BucketId bucketId,
                                      storage::spi::BucketInfo::ActiveState newState,
                                      IGenericResultHandler *resultHandler)
{
    if (!_nodeUp) {
        Result result(Result::TRANSIENT_ERROR,
                      "Cannot set bucket active state when node is down");
        resultHandler->handle(result);
        return;
    }
    bool active = (newState == storage::spi::BucketInfo::ACTIVE);
    LOG(debug, "performSetCurrentState(%s, %s)",
        bucketId.toString().c_str(), (active ? "ACTIVE" : "NOT_ACTIVE"));
    _ready->setBucketState(bucketId, active);
    if (!_changedHandlers.empty()) {
        typedef std::vector<IBucketStateChangedHandler *> Chv;
        Chv &chs(_changedHandlers);
        for (Chv::const_iterator itr = chs.begin(); itr != chs.end(); ++itr) {
            (*itr)->notifyBucketStateChanged(bucketId, newState);
        }
    }
    resultHandler->handle(Result());
}
Ejemplo n.º 7
0
int main (int argc, char *argv[])
{
  INIT_SECURITY_INTERFACE pInitSecurityInterface;
  
  // set buffer width of console
  setw (300);
  
  puts ("\n  [ cms v0.1 - Copyleft 2015 (x) @Odzhan\n");
  
  // set up default values
  args.address   = NULL;
  args.ai_family = AF_INET;
  args.port      = DEFAULT_PORT;
  args.port_nbr  = atoi(args.port);
  
  pInitSecurityInterface = (INIT_SECURITY_INTERFACE)GetProcAddress(LoadLibrary("Secur32"), "InitSecurityInterfaceA" );
  if (pInitSecurityInterface==NULL) printf ("didn't resolve");
  sspi = pInitSecurityInterface();
  
  // process command line
  parse_args(argc, argv);

  // resolve address and open socket
  if (open_tcp ()) 
  {
    start_handler ();
      
    // create credentials
    if (create_creds()==SEC_E_OK)
    {
      // connect to server
      if (connect (s, ai_addr, ai_addrlen) != SOCKET_ERROR) {
        // perform the handshake
        if (chs () == SEC_E_OK) {
          printf ("  [ connected\n\n");
          secure_info();
          ss=sspi->QueryContextAttributes (&hContext, SECPKG_ATTR_STREAM_SIZES, &Sizes );
          cbBufferLen  = Sizes.cbHeader  +  Sizes.cbMaximumMessage  +  Sizes.cbTrailer;
          pbBufferIn        = LocalAlloc(LMEM_FIXED, cbBufferLen);
          pbBufferOut       = LocalAlloc(LMEM_FIXED, cbBufferLen);
          pbDataIn=pbBufferIn + Sizes.cbHeader;
          pbDataOut=pbBufferOut + Sizes.cbHeader;
          cbBufferLen = Sizes.cbMaximumMessage;
          
          printf ("  [ running cmd\n");
          cmd();
            
        } else {
          printf ("  [ handshake failed\n");
        }
      } else {
        printf ("  [ unable to connect\n");
      }
    } else {
      printf ("  [ error creating credentials\n");
    }
    stop_handler ();
    close_tcp();
  }
  return 0;
}